code: def test_model_save_no_extension(self):
      import torch
  
      num_tokens = 3
      embedding_size = 5
  
      class TestModule(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.embedding = torch.nn.Embedding(
                  num_tokens, embedding_size
              )
  
          def forward(self, x):
              return self.embedding(x)
  
      model = TestModule()
      model.eval()
  
      example_input = torch.randint(
          high=num_tokens, size=(2,), dtype=torch.int64
      )
      traced_model = torch.jit.trace(model, example_input)
  
      mlmodel = coremltools.convert(
          traced_model,
          package_dir=None,
          source="pytorch",
          convert_to="mlprogram",
          inputs=[
              coremltools.TensorType(
                  name="input",
                  shape=example_input.shape,
                  dtype=example_input.numpy().dtype,
              )
          ],
      )
      assert isinstance(mlmodel, MLModel)
  
      package = tempfile.TemporaryDirectory()
      package.cleanup()
      package_path = package.name
  
      mlmodel.save(package_path)
      assert not os.path.exists(package_path)
  
      package_path = package_path + ".mlpackage"
      assert os.path.exists(package_path)
  
      shutil.rmtree(package_path)
  
imports: import os
  import shutil
  import tempfile
  import numpy
  import pytest
  import coremltools
  from coremltools import ComputeUnit, utils
  from coremltools._deps import _HAS_TORCH
  from coremltools.converters.mil import Builder
  from coremltools.libmodelpackage import ModelPackage
  from coremltools.models import MLModel
  from coremltools.models.utils import _MLPACKAGE_AUTHOR_NAME, _WEIGHTS_DIR_NAME
  from coremltools.proto import Model_pb2
label_desc: Use image node_id 12 for calling the TestMLModel obj's underlying member method code with example usage: obj.test_model_save_no_extension() and returns: self