code: def verify_torchscript(
      model, output, input_examples, check_tolerance=0.01
  ):
      all_good = True
      for input_example in input_examples:
          input_list, input_dict = parse_input_example(input_example)
          # We disable autocast here to make sure exported TS will run under Triton or other C++ env
          with torch.cuda.amp.autocast(enabled=False):
              output_example = model.forward(*input_list, **input_dict)
              ts_model = torch.jit.load(output)
              all_good = all_good and run_ts_and_compare(
                  ts_model,
                  input_list,
                  input_dict,
                  output_example,
                  check_tolerance,
              )
      status = "SUCCESS" if all_good else "FAIL"
      logging.info(
          f"Torchscript generated at {output} verified with torchscript forward : "
          + status
      )
      return all_good
  
imports: import os
  from contextlib import nullcontext
  from enum import Enum
  from typing import Callable, Dict, Optional, Type
  import onnx
  import torch
  import torch.nn
  import torch.nn.functional
  from nemo.utils import CastToFloat, CastToFloatAll, logging
label_desc: Use image node_id 7 for calling a global function with example usage: verify_torchscript(model, output, input_examples, check_tolerance) and returns: all_good