code: def generate_models():
      class NNLinearModel(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.linear = torch.nn.Linear(5, 1, bias=False)
              torch.nn.init.ones_(self.linear.weight)
  
          def forward(self, x: torch.Tensor):
              return self.linear(x)
  
      nn_model = NNLinearModel()
  
      tracing_inp = torch.ones(5)
      yield torch.jit.trace(nn_model, tracing_inp)
  
      yield torch.jit.script(nn_model)
  
file_path: BentoML/tests/integration/frameworks/models/torchscript.py
imports: from __future__ import annotations
  import numpy
  import pandas
  import torch
  import torch.nn
  import bentoml
  from .None import FrameworkTestModel
  from .None import FrameworkTestModelConfiguration
  from .None import FrameworkTestModelInput
label_desc: Use image node_id 1 for calling a global function with example usage: generate_models() and returns: self