code: def calculate_pixel_accuracy(
      out_value, mace_out_value, output_shape, output_data_format
  ):
      out_value = out_value.reshape(output_shape)
      mace_out_value = mace_out_value.reshape(output_shape)
      if (
          len(output_shape) == 4
          and output_data_format == common.DataFormat.NCHW
      ):
          out_value = out_value.transpose([0, 2, 3, 1])
          mace_out_value = mace_out_value.transpose([0, 2, 3, 1])
      if len(out_value.shape) < 2:
          return 1.0
      out_value = out_value.reshape((-1, out_value.shape[-1]))
      batches = out_value.shape[0]
      classes = out_value.shape[1]
      mace_out_value = mace_out_value.reshape((batches, classes))
      correct_count = 0
      for i in range(batches):
          if np.argmax(out_value[i]) == np.argmax(mace_out_value[i]):
              correct_count += 1
      return 1.0 * correct_count / batches
  
imports: import argparse
  import sys
  import os
  import os.path
  import numpy
  import six
  import common
label_desc: Use image node_id 4 for calling a global function with example usage: calculate_pixel_accuracy(out_value, mace_out_value, output_shape, output_data_format) and returns: unknown, int