code: def compare_model_outputs(pt_mdl, sess, test_data):
      """Given some testing data, compare the output of pytorch and tensorflow models.
  
      Arguments:
          pt_mdl {torch.nn.Module} -- Pytorch model.
          sess {tensorflow.Session} -- Tensorflow session object.
          test_data {torch.Tensor} -- Pytorch tensor.
      """
      print("\nPassing test data through TF model\n")
      if isinstance(sess, tf.Session):
          images_placeholder = (
              tf.get_default_graph().get_tensor_by_name("input:0")
          )
          phase_train_placeholder = (
              tf.get_default_graph().get_tensor_by_name("phase_train:0")
          )
          embeddings = tf.get_default_graph().get_tensor_by_name(
              "embeddings:0"
          )
          feed_dict = {
              images_placeholder: test_data.numpy(),
              phase_train_placeholder: False,
          }
          tf_output = torch.tensor(
              sess.run(embeddings, feed_dict=feed_dict)
          )
      else:
          tf_output = sess(test_data)
  
      print(tf_output)
  
      print("\nPassing test data through PT model\n")
      pt_output = pt_mdl(test_data.permute(0, 3, 1, 2))
      print(pt_output)
  
      distance = (tf_output - pt_output).norm()
      print(f"\nDistance {distance}\n")
  
imports: import tensorflow
  import torch
  import json
  import os, sys
  from dependencies.facenet.src import facenet
  from dependencies.facenet.src.models import inception_resnet_v1
  from dependencies.facenet.src.align import detect_face
  from models.inception_resnet_v1 import InceptionResnetV1
  from models.mtcnn import PNet, RNet, ONet
label_desc: Use image node_id 17 for calling a global function with example usage: compare_model_outputs(pt_mdl, sess, test_data) without return types