code: def test_add_reduce_sum(dtype):
      ifm_shape = (1, 2, 2, 4)
      accel_type = "ethos-u55-256"
      np.random.seed(0)
  
      def create_model():
          ifm = relay.var("ifm", shape=ifm_shape, dtype=dtype)
          ifm2 = relay.var("ifm2", shape=ifm_shape, dtype=dtype)
          ifm_scale = 0.0 if dtype == "int32" else 1.0
          op = infra.make_ethosu_binary_elementwise(
              ifm,
              ifm2,
              ifm_shape[3],
              ifm_shape[3],
              "ADD",
              dtype,
              ifm_scale=ifm_scale,
              ifm2_scale=ifm_scale,
          )
          op = infra.make_ethosu_pooling(
              ifm=op,
              pooling_type="SUM",
              pool_shape=(1, 1),
              ofm_channels=1,
              ofm_dtype="int32",
              strides=(1, 1),
              padding=(0, 0, 0, 0),
              rounding_mode="NATURAL",
          )
          return tvm.IRModule.from_expr(relay.Function([ifm, ifm2], op))
  
      def generate_output_data(input_data):
          lhs = input_data["ifm"]
          rhs = input_data["ifm2"]
          # reduce_sum output type is int32.
          output_dtype = "int32"
          add = lhs + rhs
          return [np.sum(add, axis=3).astype(output_dtype)]
  
      cpu_mod = create_model()
  
      # Generate reference data
      in_min, in_max = -10, 19
      lhs = np.random.randint(
          in_min, in_max, size=ifm_shape, dtype=dtype
      )
      rhs = np.random.randint(
          in_min, in_max, size=ifm_shape, dtype=dtype
      )
      input_data = {
          "ifm": lhs,
          "ifm2": rhs,
      }
      output_data = {"output": generate_output_data(input_data)[0]}
      ethosu_mod = infra.create_ethosu_partition(cpu_mod)
  
      infra.compare_ethosu_with_reference(
          ethosu_mod, input_data, output_data, accel_type
      )
  
imports: import pytest
  import numpy
  import tflite.Model
  import tvm
  import tensorflow
  from tvm import relay
  from tvm.relay.backend.contrib.ethosu import util
  from tvm.relay.op.contrib.ethosu import partition_for_ethosu
  from tvm.testing.aot import generate_ref_data
  from .None import infra
label_desc: Use image node_id 18 for calling a global function with example usage: test_add_reduce_sum(dtype) and returns: tvm, list