class_docstr: Object that perform the training and active learning iteration.
  
  Args:
      dataset (ActiveLearningDataset): Dataset with some sample already labelled.
      heuristic (Heuristic): Heuristic from baal.active.heuristics.
      query_size (int): Number of sample to label per step.
      max_sample (int): Limit the number of sample used (-1 is no limit).
      **kwargs: Parameters forwarded to `get_probabilities`
          and to pytorch_ligthning Trainer.__init__
docstr: Predict on the pool loader.
  
  Args:
      model: Model to be used in prediction. If None, will get the Trainer's model.
      dataloader (Optional[DataLoader]): If provided, will predict on this dataloader.
                                          Otherwise, uses model.pool_dataloader().
  
  Returns:
      Numpy arrays with all the predictions.
docstr_tok: ["Predict","on","the","pool","loader",".","Args",":","model",":","Model","to","be","used","in","prediction",".","If","None",",","will","get","the","Trainer","'s","model",".","dataloader","(","Optional","[","DataLoader","]",")",":","If","provided",",","will","predict","on","this","dataloader",".","Otherwise",",","uses","model.pool_dataloader","(",")",".","Returns",":","Numpy","arrays","with","all","the","predictions","."]
code: def predict_on_dataset_generator(
      self,
      model=None,
      dataloader: Optional[DataLoader] = None,
      *args,
      **kwargs,
  ):
      """Predict on the pool loader.
  
      Args:
          model: Model to be used in prediction. If None, will get the Trainer's model.
          dataloader (Optional[DataLoader]): If provided, will predict on this dataloader.
                                              Otherwise, uses model.pool_dataloader().
  
      Returns:
          Numpy arrays with all the predictions.
      """
      model = model or self.lightning_module
      model.eval()
      if isinstance(self.accelerator, CUDAAccelerator):
          model.cuda(self.strategy.root_device.index)
      dataloader = dataloader or model.pool_dataloader()
      if len(dataloader) == 0:
          return None
  
      log.info("Start Predict", dataset=len(dataloader))
      for idx, batch in enumerate(
          tqdm(dataloader, total=len(dataloader), file=sys.stdout)
      ):
          if isinstance(self.accelerator, CUDAAccelerator):
              batch = to_cuda(batch)
          pred = model.predict_step(batch, idx)
          yield map_on_tensor(lambda x: x.detach().cpu().numpy(), pred)
      # teardown, TODO customize this later?
      model.cpu()
  
imports: import sys
  import types
  import warnings
  from collections.abc import Sequence
  from typing import Dict, Any, Optional
  import numpy
  import structlog
  import torch
  from pytorch_lightning import Trainer, Callback, LightningDataModule, LightningModule
  from pytorch_lightning.accelerators import CUDAAccelerator
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from baal.active import ActiveLearningDataset
  from baal.active.heuristics import heuristics
  from baal.modelwrapper import mc_inference
  from baal.utils.cuda_utils import to_cuda
  from baal.utils.iterutils import map_on_tensor
label_desc: Use image node_id 3 for calling the BaalTrainer obj's underlying member method code with example usage: obj.predict_on_dataset_generator(model, dataloader) and returns: None