MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __init__

Method __init__

monai/inferers/inferer.py:710–720  ·  view source on GitHub ↗
(
        self, cam_name: str, target_layers: str, class_idx: int | None = None, *args: Any, **kwargs: Any
    )

Source from the content-addressed store, hash-verified

708 """
709
710 def __init__(
711 self, cam_name: str, target_layers: str, class_idx: int | None = None, *args: Any, **kwargs: Any
712 ) -> None:
713 Inferer.__init__(self)
714 if cam_name.lower() not in ("cam", "gradcam", "gradcampp"):
715 raise ValueError("cam_name should be: 'CAM', 'GradCAM' or 'GradCAMpp'.")
716 self.cam_name = cam_name.lower()
717 self.target_layers = target_layers
718 self.class_idx = class_idx
719 self.args = args
720 self.kwargs = kwargs
721
722 def __call__(self, inputs: torch.Tensor, network: nn.Module, *args: Any, **kwargs: Any): # type: ignore
723 """Unified callable function API of Inferers.

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected