class_docstr: Exteded Trainer for FLash tasks.
  
  >>> Trainer()  # doctest: +ELLIPSIS
  <...trainer.Trainer object at ...>
class_docstr_tok: ["Exteded","Trainer","for","FLash","tasks",".",">",">",">","Trainer","(",")","#","doctest",":","+ELLIPSIS","<","...","trainer.Trainer","object","at","...",">"]
docstr: Run inference on your data.
  
  This will call the model forward function to compute predictions.
  Useful to perform distributed and batched predictions. Logging is disabled in the prediction hooks.
  
  Args:
      model: The model to predict with.
      dataloaders: A :class:`torch.utils.data.DataLoader` or a sequence of them,
          or a :class:`~pytorch_lightning.core.datamodule.LightningDataModule` specifying prediction samples.
      output: The :class:`~flash.core.data.io.output.Output` to use to transform predict outputs.
      kwargs: Additional keyword arguments to pass to :meth:`~pytorch_lightning.Trainer.predict`.
  
  Returns:
      Returns a list of dictionaries, one for each provided dataloader containing their respective predictions.
docstr_tok: ["Run","inference","on","your","data",".","This","will","call","the","model","forward","function","to","compute","predictions",".","Useful","to","perform","distributed","and","batched","predictions",".","Logging","is","disabled","in","the","prediction","hooks",".","Args",":","model",":","The","model","to","predict","with",".","dataloaders",":","A",":","class",":","`","torch.utils.data.DataLoader","`","or","a","sequence","of","them",",","or","a",":","class",":","`","~pytorch_lightning.core.datamodule.LightningDataModule","`","specifying","prediction","samples",".","output",":","The",":","class",":","`","~flash.core.data.io.output.Output","`","to","use","to","transform","predict","outputs",".","kwargs",":","Additional","keyword","arguments","to","pass","to",":","meth",":","`","~pytorch_lightning.Trainer.predict","`",".","Returns",":","Returns","a","list","of","dictionaries",",","one","for","each","provided","dataloader","containing","their","respective","predictions","."]
code: def predict(
      self,
      model: Optional[LightningModule] = None,
      dataloaders: Optional[
          Union[DataLoader, LightningDataModule]
      ] = None,
      output: Union[Output, str] = None,
      **kwargs,
  ):
      r"""Run inference on your data.
  
      This will call the model forward function to compute predictions.
      Useful to perform distributed and batched predictions. Logging is disabled in the prediction hooks.
  
      Args:
          model: The model to predict with.
          dataloaders: A :class:`torch.utils.data.DataLoader` or a sequence of them,
              or a :class:`~pytorch_lightning.core.datamodule.LightningDataModule` specifying prediction samples.
          output: The :class:`~flash.core.data.io.output.Output` to use to transform predict outputs.
          kwargs: Additional keyword arguments to pass to :meth:`~pytorch_lightning.Trainer.predict`.
  
      Returns:
          Returns a list of dictionaries, one for each provided dataloader containing their respective predictions.
  
      """
      # Note: Prediction on TPU device with multi cores is not supported yet
      if (
          isinstance(self.accelerator, TPUAccelerator)
          and self.num_devices > 1
      ):
          raise NotImplementedError(
              f"Prediction on TPU device with multi-cores (requested cores: {self.num_devices}) is not supported yet."
          )
      model = model or self.lightning_module
      output_transform = (
          getattr(model, "_output_transform", None) or OutputTransform()
      )
      if output is None:
          output = Output()
      if isinstance(output, str) and isinstance(model, Task):
          output = (
              getattr(model, "outputs", FlashRegistry("outputs"))
              .get(output)
              .from_task(model)
          )
  
      old_callbacks = self.callbacks
      self.callbacks = self._merge_callbacks(
          self.callbacks,
          [TransformPredictions(output_transform, output)],
      )
  
      result = super().predict(model, dataloaders, **kwargs)
  
      self.callbacks = old_callbacks
  
      return result
  
imports: import inspect
  import warnings
  from argparse import ArgumentParser, Namespace
  from functools import wraps
  from typing import Callable, List, Optional, Tuple, Union
  import torch
  from pytorch_lightning import LightningDataModule, LightningModule
  from pytorch_lightning import Trainer
  from pytorch_lightning.accelerators.tpu import TPUAccelerator
  from pytorch_lightning.callbacks import BaseFinetuning
  from pytorch_lightning.utilities.argparse import add_argparse_args, get_init_arguments_and_types, parse_env_variables
  from torch.utils.data import DataLoader
  import flash
  from flash.core.data.io.output import Output
  from flash.core.data.io.output_transform import OutputTransform
  from flash.core.data.io.transform_predictions import TransformPredictions
  from flash.core.model import Task
  from flash.core.registry import FlashRegistry
label_desc: Use image node_id 4 for calling the Trainer obj's underlying member method code with example usage: obj.predict(model, dataloaders, output) and returns: result