code: def test_operators_with_and_without_weights():
      # fmt: off
      @tvm.script.ir_module
      class InputModule:
          @T.prim_func
          def main(buffer2: T.Buffer((80,), "uint8"), buffer3: T.Buffer((64,), "uint8")) -> None:
              T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
              buffer0 = T.Buffer([390336], "int8")
              buffer1 = T.Buffer([97156], "int8")
              buffer6 = T.Buffer([390336], "int8")
              # body
              p2_data = T.allocate([80], "uint8", "global")
              p2 = T.Buffer([80], "uint8", data=p2_data)
              p3_data = T.allocate([64], "uint8", "global")
              p3 = T.Buffer([64], "uint8", data=p3_data)
              T.evaluate(T.call_extern("ethosu_pooling", "int8", 214, 227, 2, 214, 0, 227, buffer1[0], 0, 0, 0, T.float32(1), 0, "NHWC", 454, 2, 1, "int8", 214, 114, 2, 214, 0, 114, buffer0[0], 0, 0, 0, T.float32(1), 0, "NHCWB16", 1824, 16, 1, "MAX", 2, 1, 2, 1, 1, 1, 0, 0, 0, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
              T.evaluate(T.call_extern("ethosu_copy", buffer2[0], 80, p2[0], dtype="handle"))
              T.evaluate(T.call_extern("ethosu_copy", buffer3[0], 64, p3[0], dtype="handle"))
              T.evaluate(T.call_extern("ethosu_conv2d", "int8", 214, 114, 2, 214, 0, 114, buffer0[0], 0, 0, 0, T.float32(0.00392157), -128, "NHCWB16", 1824, 16, 1, "int8", 214, 114, 5, 214, 0, 114, buffer6[0], 0, 0, 0, T.float32(0.0174839), -128, "NHCWB16", 1824, 16, 1, 3, 1, 1, 1, 1, 2, p2[0], 80, 0, p3[0], 64, 0, 1, 0, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
  
  
      @tvm.script.ir_module
      class ReferenceModule:
          @T.prim_func
          def main(buffer2: T.Buffer((144,), "uint8")) -> None:
              T.func_attr({"from_legacy_te_schedule": True, "global_symbol": "main", "tir.noalias": True})
              buffer0 = T.Buffer([390336], "int8")
              buffer1 = T.Buffer([97156], "int8")
              buffer6 = T.Buffer([390336], "int8")
              # body
              p3_data = T.allocate([144], "uint8", "global")
              p3 = T.Buffer([144], "uint8", data=p3_data)
              T.evaluate(T.call_extern("ethosu_pooling", "int8", 214, 227, 2, 214, 0, 227, buffer1[0], 0, 0, 0, T.float32(1), 0, "NHWC", 454, 2, 1, "int8", 214, 114, 2, 214, 0, 114, buffer0[0], 0, 0, 0, T.float32(1), 0, "NHCWB16", 1824, 16, 1, "MAX", 2, 1, 2, 1, 1, 1, 0, 0, 0, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
              T.evaluate(T.call_extern("ethosu_copy", buffer2[0], 144, p3[0], dtype="handle"))
              T.evaluate(T.call_extern("ethosu_conv2d", "int8", 214, 114, 2, 214, 0, 114, buffer0[0], 0, 0, 0, T.float32(0.00392157), -128, "NHCWB16", 1824, 16, 1, "int8", 214, 114, 5, 214, 0, 114, buffer6[0], 0, 0, 0, T.float32(0.0174839), -128, "NHCWB16", 1824, 16, 1, 3, 1, 1, 1, 1, 2, p3[0], 80, 0, p3[80], 64, 0, 1, 0, 1, "NONE", 0, 0, "TFL", "NONE", 0, 0, 0, dtype="handle"))
      # fmt: on
  
      const_dict = {
          0: np.array([0], dtype=np.uint8),
          1: np.array([1], dtype=np.uint8),
      }
      new_const_dict = {
          0: np.concatenate((const_dict[0], const_dict[1]))
      }
      test_mod, const_dict = MergeConstants(const_dict)(InputModule)
      reference_mod = ReferenceModule
      tvm.ir.assert_structural_equal(test_mod, reference_mod, True)
      check_const_dictionaries(const_dict, new_const_dict)
  
file_path: tvm/tests/python/contrib/test_ethosu/test_merge_constants.py
imports: import pytest
  import tvm
  from tvm.script import tir
  from tvm.relay.backend.contrib.ethosu.tir.passes import MergeConstants
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: test_operators_with_and_without_weights() without return types