code: def global_avg_pool2d_u8(
      data: te.Tensor,
      odtype: str,
      input_zero_point: int,
      input_scale: float,
      output_zero_point: int,
      output_scale: float,
  ):
      """global_avg_pool2d"""
      input_b, input_c, input_h, input_w = data.shape
      oshape = (input_b, input_c) + (1, 1)
  
      if input_h * input_w < 256:
          bits = "16"
      else:
          bits = "32"
  
      if odtype == "uint8":
          temp_dtype = "uint" + bits
      elif odtype == "int8":
          temp_dtype = "int" + bits
      else:
          raise RuntimeError(f"Unsupported output dtype, {odtype}'")
  
      pool_area = input_h * input_w
      rh_r = te.reduce_axis((0, input_h), name="rh_r")
      rw_r = te.reduce_axis((0, input_w), name="rw_r")
  
      scale_with_area = input_scale / (output_scale * int(pool_area))
      scale_fixed_point, rsh = get_fixed_point_value(
          scale_with_area, "int16"
      )
      corr = (
          output_zero_point << rsh
      ) - input_zero_point * pool_area * scale_fixed_point
  
      sum_compute = te.compute(
          oshape,
          lambda n, c, h, w: te.sum(
              data[n, c, h + rh_r, w + rw_r].astype(temp_dtype),
              axis=[rh_r, rw_r],
          ),
          name="sum",
      )
  
      avg_compute = te.compute(
          oshape,
          lambda n, c, h, w: saturate(
              ((sum_compute[n, c, h, w] * scale_fixed_point) + corr)
              >> rsh,
              odtype,
          ).astype(odtype),
          name="global_avg_pool2d",
      )
  
      return avg_compute
  
imports: from tvm import te
  from tvm import tir
  from ..utils import get_layout_transform_fn, get_fixed_point_value, saturate
label_desc: Use image node_id 1 for calling a global function with example usage: global_avg_pool2d_u8(data, odtype, input_zero_point, input_scale, output_zero_point, output_scale) and returns: avg_compute