class_docstr: Top-level loop where prediction starts.
class_docstr_tok: ["Top-level","loop","where","prediction","starts","."]
docstr: Resets the internal state of the loop for a new run.
docstr_tok: ["Resets","the","internal","state","of","the","loop","for","a","new","run","."]
code: def reset(self) -> None:
      """Resets the internal state of the loop for a new run."""
      self.batch_progress.reset_on_run()
  
      assert self.trainer.state.stage is not None
      data_fetcher = _select_data_fetcher(
          self.trainer, self.trainer.state.stage
      )
      combined_loader = self._combined_loader
      assert combined_loader is not None
      if combined_loader._mode != "sequential":
          raise ValueError(
              '`trainer.predict()` only supports the `CombinedLoader(mode="sequential")` mode.'
          )
  
      # set the per-dataloader limits
      combined_loader.limits = self.max_batches
      data_fetcher.setup(combined_loader)
      iter(data_fetcher)  # creates the iterator inside the fetcher
  
      # add the previous `fetched` value to properly track `is_last_batch` with no prefetching
      data_fetcher.fetched += self.batch_progress.current.ready
      data_fetcher._start_profiler = self._on_before_fetch
      data_fetcher._stop_profiler = self._on_after_fetch
      self._data_fetcher = data_fetcher
  
      num_dataloaders = self.num_dataloaders
      self.epoch_batch_indices = [[] for _ in range(num_dataloaders)]
      self._predictions = [[] for _ in range(num_dataloaders)]
  
imports: from collections import OrderedDict
  from typing import Any, Iterator, List, Optional, Union
  import torch
  from lightning_utilities import WarningCache
  import lightning.pytorch
  from lightning.fabric.utilities import move_data_to_device
  from lightning.pytorch.callbacks import BasePredictionWriter
  from lightning.pytorch.loops.fetchers import _DataFetcher, _DataLoaderIterDataFetcher
  from lightning.pytorch.loops.loop import _Loop
  from lightning.pytorch.loops.progress import _Progress
  from lightning.pytorch.loops.utilities import _no_grad_context, _select_data_fetcher, _verify_dataloader_idx_requirement
  from lightning.pytorch.overrides.distributed import _IndexBatchSamplerWrapper
  from lightning.pytorch.strategies.launchers import _MultiProcessingLauncher
  from lightning.pytorch.trainer import call
  from lightning.pytorch.trainer.connectors.data_connector import _check_dataloader_iterable, _DataLoaderSource, _parse_num_batches, _process_dataloader, _request_dataloader
  from lightning.pytorch.trainer.states import RunningStage, TrainerFn
  from lightning.pytorch.utilities.combined_loader import CombinedLoader
  from lightning.pytorch.utilities.data import has_len_all_ranks
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.model_helpers import _ModuleMode
  from lightning.pytorch.utilities.signature_utils import is_param_in_hook_signature
  from lightning.pytorch.utilities.types import _PREDICT_OUTPUT
label_desc: Use image node_id 9 for calling the _PredictionLoop obj's underlying member method code with example usage: obj.reset() without return types