code: def assertion_check(
      py_out: Union[Tensor, Dict, Tuple],
      jit_out: Union[Tensor, Dict, Tuple],
  ) -> None:
      if isinstance(py_out, Dict):
          assert isinstance(jit_out, Dict)
          keys = py_out.keys()
          for k in keys:
              np.testing.assert_almost_equal(
                  py_out[k].cpu().numpy(),
                  jit_out[k].cpu().numpy(),
                  decimal=3,
                  verbose=True,
              )
      elif isinstance(py_out, Tensor):
          assert isinstance(jit_out, Tensor)
          np.testing.assert_almost_equal(
              py_out.cpu().numpy(),
              jit_out.cpu().numpy(),
              decimal=3,
              verbose=True,
          )
      elif isinstance(py_out, Tuple):
          assert isinstance(jit_out, Tuple)
          for x, y in zip(py_out, jit_out):
              np.testing.assert_almost_equal(
                  x.cpu().numpy(),
                  y.cpu().numpy(),
                  decimal=3,
                  verbose=True,
              )
  
      else:
          raise NotImplementedError(
              "Only Dictionary[Tensors] or Tuple[Tensors] or Tensors are supported as outputs"
          )
  
file_path: ml-cvnets/utils/pytorch_to_coreml.py
imports: from typing import Dict, Optional, Tuple, Union
  import coremltools
  import numpy
  import torch
  from PIL import Image
  from torch import Tensor
  from torch.utils.mobile_optimizer import optimize_for_mobile
  from torchvision.transforms import functional
  from utils import logger
  from utils.tensor_utils import create_rand_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: assertion_check(py_out, jit_out) without return types