class_docstr: A base class for model inference.
  Extend this class to support operations during inference, e.g. a sliding window method.
  
  Example code::
  
      device = torch.device("cuda:0")
      transform = Compose([ToTensor(), LoadImage(image_only=True)])
      data = transform(img_path).to(device)
      model = UNet(...).to(device)
      inferer = SlidingWindowInferer(...)
  
      model.eval()
      with torch.no_grad():
          pred = inferer(inputs=data, network=model)
      ...
class_docstr_tok: ["A","base","class","for","model","inference",".","Extend","this","class","to","support","operations","during","inference",",","e.g",".","a","sliding","window","method",".","Example","code",":",":","device","=","torch.device","(","``","cuda:0","''",")","transform","=","Compose","(","[","ToTensor","(",")",",","LoadImage","(","image_only=True",")","]",")","data","=","transform","(","img_path",")",".to","(","device",")","model","=","UNet","(","...",")",".to","(","device",")","inferer","=","SlidingWindowInferer","(","...",")","model.eval","(",")","with","torch.no_grad","(",")",":","pred","=","inferer","(","inputs=data",",","network=model",")","..."]
docstr: Run inference on `inputs` with the `network` model.
  
  Args:
      inputs: input of the model inference.
      network: model for inference.
      args: optional args to be passed to ``network``.
      kwargs: optional keyword args to be passed to ``network``.
  
  Raises:
      NotImplementedError: When the subclass does not override this method.
docstr_tok: ["Run","inference","on","`","inputs","`","with","the","`","network","`","model",".","Args",":","inputs",":","input","of","the","model","inference",".","network",":","model","for","inference",".","args",":","optional","args","to","be","passed","to","``","network","``",".","kwargs",":","optional","keyword","args","to","be","passed","to","``","network","``",".","Raises",":","NotImplementedError",":","When","the","subclass","does","not","override","this","method","."]
code: def __call__(
      self,
      inputs: torch.Tensor,
      network: Callable,
      *args: Any,
      **kwargs: Any,
  ) -> Any:
      """
      Run inference on `inputs` with the `network` model.
  
      Args:
          inputs: input of the model inference.
          network: model for inference.
          args: optional args to be passed to ``network``.
          kwargs: optional keyword args to be passed to ``network``.
  
      Raises:
          NotImplementedError: When the subclass does not override this method.
  
      """
      raise NotImplementedError(
          f"Subclass {self.__class__.__name__} must implement this method."
      )
  
imports: from __future__ import annotations
  import warnings
  from abc import ABC, abstractmethod
  from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
  from pydoc import locate
  from typing import Any
  import torch
  import torch.nn
  from monai.apps.utils import get_logger
  from monai.data.meta_tensor import MetaTensor
  from monai.data.thread_buffer import ThreadBuffer
  from monai.inferers.merger import AvgMerger, Merger
  from monai.inferers.splitter import Splitter
  from monai.inferers.utils import compute_importance_map, sliding_window_inference
  from monai.utils import BlendMode, PatchKeys, PytorchPadMode, ensure_tuple, optional_import
  from monai.visualize import CAM, GradCAM, GradCAMpp
label_desc: Use image node_id 1 for calling the Inferer obj's underlying member method code with example usage: obj.__call__(inputs, network) without return types