code: def _compare_outputs(
      self,
      original_framework,
      target_framework,
      network_name,
      original_predict,
      converted_predict,
      need_assert=True,
  ):
      # Function self.assertEquals has deprecated, change to assertEqual
      if (
          converted_predict is None or original_predict is None
      ) and not need_assert:
          return
  
      # self.assertEqual(original_predict.shape, converted_predict.shape)
      original_predict = original_predict.flatten()
      converted_predict = converted_predict.flatten()
      len1 = original_predict.shape[0]
      len2 = converted_predict.shape[0]
      length = min(len1, len2)
      original_predict = np.sort(original_predict)[::-1]
      converted_predict = np.sort(converted_predict)[::-1]
      original_predict = original_predict[0:length]
      converted_predict = converted_predict[0:length]
      error, ind = _compute_max_relative_error(
          converted_predict, original_predict
      )
      L1_error = _compute_L1_error(converted_predict, original_predict)
      SNR, PSNR = _compute_SNR(converted_predict, original_predict)
      print("error:", error)
      print("L1 error:", L1_error)
      print("SNR:", SNR)
      print("PSNR:", PSNR)
  
      if need_assert:
          self.assertGreater(
              SNR,
              self.snr_thresh,
              "Error in converting {} from {} to {}".format(
                  network_name, original_framework, target_framework
              ),
          )
          self.assertGreater(
              PSNR,
              self.psnr_thresh,
              "Error in converting {} from {} to {}".format(
                  network_name, original_framework, target_framework
              ),
          )
          self.assertLess(
              error,
              self.err_thresh,
              "Error in converting {} from {} to {}".format(
                  network_name, original_framework, target_framework
              ),
          )
  
file_path: MMdnn/tests/utils.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  import os
  import unittest
  import numpy
label_desc: Use image node_id 2 for calling the CorrectnessTest obj's underlying member method code with example usage: obj._compare_outputs(original_framework, target_framework, network_name, original_predict, converted_predict, need_assert) without return types