code: def _save_model(model: Module, path: Path):
      try:
          save_with_torch_fx(model, path)
      except Exception as ex:
          logger.warning(
              f"Got an error while exporting with TorchFX. The model will be "
              f"saved using the standard PyTorch save pickling method. Error "
              f"got: {ex}"
          )
          torch.save(model, path / "model.pt")
          return path / "model.pt"
      else:
          return path
  
imports: import json
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Callable, Dict
  import numpy
  from loguru import logger
  from nebullvm.operations.optimizations.compressors.base import Compressor
  from nebullvm.optional_modules.torch import torch, Module
  from nebullvm.tools.data import DataManager
  from nebullvm.tools.pytorch import save_with_torch_fx, load_with_torch_fx
  from nebullvm.tools.venv import run_in_different_venv
label_desc: Use image node_id 1 for calling a global function with example usage: _save_model(model, path) and returns: path, unknown