class_docstr: PyTorch implementation for the inference.
  
  Args:
      path (str | Path): Path to Torch model weights.
      device (str): Device to use for inference. Options are auto, cpu, cuda. Defaults to "auto".
class_docstr_tok: ["PyTorch","implementation","for","the","inference",".","Args",":","path","(","str","|","Path",")",":","Path","to","Torch","model","weights",".","device","(","str",")",":","Device","to","use","for","inference",".","Options","are","auto",",","cpu",",","cuda",".","Defaults","to","``","auto","''","."]
docstr: Load the checkpoint.
  
  Args:
      path (str | Path): Path to the torch ckpt file.
  
  Returns:
      dict: Dictionary containing the model and metadata.
docstr_tok: ["Load","the","checkpoint",".","Args",":","path","(","str","|","Path",")",":","Path","to","the","torch","ckpt","file",".","Returns",":","dict",":","Dictionary","containing","the","model","and","metadata","."]
code: def _load_checkpoint(self, path: str | Path) -> dict:
      """Load the checkpoint.
  
      Args:
          path (str | Path): Path to the torch ckpt file.
  
      Returns:
          dict: Dictionary containing the model and metadata.
      """
      if isinstance(path, str):
          path = Path(path)
  
      if path.suffix not in (".pt", ".pth"):
          raise ValueError(
              f"Unknown torch checkpoint file format {path.suffix}. Make sure you save the Torch model."
          )
  
      checkpoint = torch.load(path, map_location=self.device)
      return checkpoint
  
imports: from __future__ import annotations
  from pathlib import Path
  from typing import Any, Sequence
  import albumentations
  import cv2
  import numpy
  import torch
  from omegaconf import DictConfig
  from torch import Tensor, nn
  from anomalib.data import TaskType
  from anomalib.data.utils.boxes import masks_to_boxes
  from .base_inferencer import Inferencer
label_desc: Use image node_id 3 for calling the TorchInferencer obj's underlying member method code with example usage: obj._load_checkpoint(path) and returns: checkpoint