code: def create_model_and_optimizer():
      import torch
  
      class Model(torch.nn.Module):
          def __init__(self):
              super(Model, self).__init__()
              self.conv1 = torch.nn.Conv2d(3, 128, (1, 1))
              self.conv2 = torch.nn.Conv2d(128, 256, (10, 10))
              self.conv3 = torch.nn.Conv2d(256, 26, (10, 10))
              self.linear = torch.nn.Linear(206, 12)
  
          def forward(self, x):
              x = self.conv1(x)
              x = self.conv2(x)
              x = self.conv3(x)
              x = self.linear(x)
              return x
  
      model = Model()
      loss_fn = torch.nn.MSELoss()
      optimizer = torch.optim.SGD(
          model.parameters(), lr=0.01, momentum=0.9
      )
  
      return model, loss_fn, optimizer
  
imports: import tempfile
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
  from coremltools.test.optimize.coreml.test_passes import TestCompressionPasses
  from coremltools.test.optimize.coreml.test_passes import TestConfigurationFromDictFromYaml
label_desc: Use image node_id 1 for calling a global function with example usage: create_model_and_optimizer() and returns: model,  loss_fn,  optimizer, x