code: def compare_output(
      output_name,
      mace_out_value,
      out_value,
      validation_threshold,
      log_file,
      output_shape,
      output_data_format,
  ):
      if mace_out_value.size != 0:
          pixel_accuracy = calculate_pixel_accuracy(
              out_value,
              mace_out_value,
              output_shape,
              output_data_format,
          )
          out_value = out_value.reshape(-1)
          mace_out_value = mace_out_value.reshape(-1)
          assert len(out_value) == len(mace_out_value)
          sqnr = calculate_sqnr(out_value, mace_out_value)
          similarity = calculate_similarity(out_value, mace_out_value)
          util.MaceLogger.summary(
              output_name
              + " MACE VS training platform"
              + " similarity: "
              + str(similarity)
              + " , sqnr: "
              + str(sqnr)
              + " , pixel_accuracy: "
              + str(pixel_accuracy)
          )
          if log_file:
              if not os.path.exists(log_file):
                  with open(log_file, "w") as f:
                      f.write(
                          "output_name,similarity,sqnr,pixel_accuracy\n"
                      )
              summary = "{output_name},{similarity},{sqnr},{pixel_accuracy}\n".format(
                  output_name=output_name,
                  similarity=similarity,
                  sqnr=sqnr,
                  pixel_accuracy=pixel_accuracy,
              )
              with open(log_file, "a") as f:
                  f.write(summary)
          elif similarity > validation_threshold:
              util.MaceLogger.summary(
                  util.StringFormatter.block("Similarity Test Passed")
              )
          else:
              util.MaceLogger.error(
                  util.StringFormatter.block("Similarity Test Failed")
              )
      else:
          util.MaceLogger.error(
              "",
              util.StringFormatter.block(
                  "Similarity Test failed because of empty output"
              ),
          )
  
imports: import os
  import sys
  import os.path
  import numpy
  import six
  from py_proto import mace_pb2
  from utils import util
  from utils.config_parser import DataFormat
  from utils.config_parser import Platform
  from utils.util import mace_check
label_desc: Use image node_id 5 for calling a global function with example usage: compare_output(output_name, mace_out_value, out_value, validation_threshold, log_file, output_shape, output_data_format) without return types