code: def from_pytorch(pytorch_model, dummy_input):
      """
      Converts a PyTorch model `pytorch_model` into a CrypTen model by tracing it
      using the input `dummy_input`.
      """
  
      # construct CrypTen model:
      f = _from_pytorch_to_bytes(pytorch_model, dummy_input)
      crypten_model = from_onnx(f)
      f.close()
  
      # set model architecture to export model back to pytorch model
      crypten_model.pytorch_model = copy.deepcopy(pytorch_model)
  
      # make sure training / eval setting is copied:
      crypten_model.train(mode=pytorch_model.training)
      return crypten_model
  
imports: import copy
  import io
  import onnx
  import torch
  import torch.onnx.symbolic_helper
  import torch.onnx.utils
  from onnx import numpy_helper
  from torch.onnx import OperatorExportTypes
  from .None import module
label_desc: Use image node_id 2 for calling a global function with example usage: from_pytorch(pytorch_model, dummy_input) and returns: crypten_model