code: def test_broadcast_respect_input_layouts():
      def before():
          x = relay.var("x", shape=(1, 16, 1, 1))
          w = relay.var("w", shape=(16, 16, 1, 1))
          x = relay.nn.conv2d(
              x,
              w,
              kernel_size=(1, 1),
              padding=(0, 0),
              channels=16,
          )
          y1 = relay.min(x, axis=[2])
          y2 = relay.min(x, axis=[3])
          z = y1 + y2
          z = relay.Function(analysis.free_vars(z), z)
          return z
  
      def alter_conv2d(attrs, inputs, tinfos, out_type):
          data, weight = inputs
          new_attrs = dict(attrs)
          new_attrs["data_layout"] = "NCHW4c"
          new_attrs["kernel_layout"] = "OIHW4i4o"
          return relay.nn.conv2d(data, weight, **new_attrs)
  
      inp = np.random.uniform(size=(1, 16, 1, 1)).astype(np.float32)
      weight = np.random.uniform(size=(16, 16, 1, 1)).astype(np.float32)
      mod = tvm.IRModule.from_expr(before())
      with TempOpAttr("nn.conv2d", "FTVMAlterOpLayout", alter_conv2d):
          with tvm.transform.PassContext(opt_level=4):
              res = relay.build_module.create_executor(
                  "graph", mod, target="llvm", device=tvm.cpu()
              ).evaluate()(inp, weight)
      with tvm.transform.PassContext(opt_level=0):
          res1 = relay.build_module.create_executor(
              "debug", mod, target="llvm", device=tvm.cpu()
          ).evaluate()(inp, weight)
      np.testing.assert_allclose(res.numpy(), res1.numpy())
  
imports: import pytest
  import tvm
  from tvm import relay, topi
  from tvm.relay import transform, analysis
  from tvm.relay.testing.temp_op_attr import TempOpAttr
  from tvm.relay.testing import run_infer_type
  import numpy
  import tvm.testing
  from tvm.relay import testing
label_desc: Use image node_id 37 for calling a global function with example usage: test_broadcast_respect_input_layouts() and returns: z, relay