code: def test_not_inplace_modify():
      def func():
          x = relay.var("x", shape=(1, 64, 56, 56))
          weight = relay.var("weight", shape=(64, 64, 3, 3))
          y = relay.nn.conv2d(
              x, weight, channels=64, kernel_size=(3, 3), padding=(1, 1)
          )
          y = relay.nn.relu(y)
          y = relay.nn.max_pool2d(
              y, pool_size=[2, 2], strides=[2, 2], padding=[0, 0, 0, 0]
          )
          y = relay.Function([x, weight], y)
          return y
  
      def alter_conv2d(attrs, inputs, tinfos, out_type):
          data, weight = inputs
          new_attrs = dict(attrs)
          new_attrs["data_layout"] = "NCHW16c"
          new_attrs["kernel_layout"] = "OIHW16i"
          return relay.nn.conv2d(data, weight, **new_attrs)
  
      with TempOpAttr("nn.conv2d", "FTVMAlterOpLayout", alter_conv2d):
          before = func()
          run_opt_pass(before, [transform.AlterOpLayout()])
          assert before.body.attrs.layout == "NCHW"
  
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 27 for calling a global function with example usage: test_not_inplace_modify() and returns: y, relay