code: def calculate_min_max(self, data, requirement):
      quantized_dimension = None
      # Get min max
      if requirement["granularity"] == QuantizeGranularity.PER_TENSOR:
          min_value = data.min()
          max_value = data.max()
      if (
          requirement["granularity"]
          == QuantizeGranularity.PER_AXIS_DIM0
      ):
          if len(data.shape) == 4:
              min_value = np.min(data, axis=(1, 2, 3))
              max_value = np.max(data, axis=(1, 2, 3))
              quantized_dimension = 0
          else:
              min_value = np.min(data)
              max_value = np.max(data)
      if (
          requirement["granularity"]
          == QuantizeGranularity.PER_AXIS_DIM3
      ):
          if len(data.shape) == 4:
              min_value = np.min(data, axis=(0, 1, 2))
              max_value = np.max(data, axis=(0, 1, 2))
              quantized_dimension = 3
          else:
              min_value = np.min(data)
              max_value = np.max(data)
      return min_value, max_value, quantized_dimension
  
imports: import numpy
  import tensorflow
  import tqdm
label_desc: Use image node_id 8 for calling the QuantizationConverter obj's underlying member method code with example usage: obj.calculate_min_max(data, requirement) and returns: min_value,  max_value,  quantized_dimension