code: def export_to_torch(
      model: AnomalyModule, metadata: dict[str, Any], export_path: Path
  ) -> None:
      """Export AnomalibModel to torch.
  
      Args:
          model (AnomalyModule): Model to export.
          export_path (Path): Path to the folder storing the exported model.
      """
      torch.save(
          obj={"model": model.model, "metadata": metadata},
          f=export_path / "model.pt",
      )
  
imports: from __future__ import annotations
  import json
  import logging
  import subprocess
  from enum import Enum
  from importlib.util import find_spec
  from pathlib import Path
  from typing import Any
  from warnings import warn
  import numpy
  import torch
  from torch import Tensor
  from torch.types import Number
  from anomalib.data.task_type import TaskType
  from anomalib.models.components import AnomalyModule
label_desc: Use image node_id 4 for calling a global function with example usage: export_to_torch(model, metadata, export_path) without return types