code: def test_slice_like_convert_layout():
      def verify_slice_like(after, expected_axes):
          # Verify if the slice_like after the convert layout has the expected axes.
          has_expected = list()
          checker = lambda x: has_expected.append(
              isinstance(x, tvm.relay.expr.Call)
              and x.op.name == "slice_like"
              and str(x.attrs.axes) == str(expected_axes)
          )
          relay.analysis.post_order_visit(after, checker)
          assert any(has_expected)
  
      def func_nhwc():
          x = relay.var("x", shape=(1, 56, 56, 64))
          weight1 = relay.var("weight1", shape=(3, 3, 64, 32))
          y = relay.nn.conv2d(
              x,
              weight1,
              channels=32,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="NHWC",
              kernel_layout="HWIO",
          )
          out = relay.slice_like(y, y, axes=[1, 2])
          return relay.Function(analysis.free_vars(out), out)
  
      after = run_opt_pass(
          func_nhwc(),
          transform.ConvertLayout({"nn.conv2d": ["NCHW", "default"]}),
      )
      verify_slice_like(after, [2, 3])
  
      def func_nchw():
          x = relay.var("x", shape=(1, 64, 56, 56))
          weight1 = relay.var("weight1", shape=(32, 64, 3, 3))
          y = relay.nn.conv2d(
              x,
              weight1,
              channels=32,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="NCHW",
              kernel_layout="OIHW",
          )
          out = relay.slice_like(y, y, axes=[2, 3])
          return relay.Function(analysis.free_vars(out), out)
  
      after = run_opt_pass(
          func_nchw(),
          transform.ConvertLayout({"nn.conv2d": ["NHWC", "default"]}),
      )
      verify_slice_like(after, [1, 2])
  
      def func_vars():
          x = relay.var("x", shape=(1, 56, 56, 64))
          weight1 = relay.var("weight1", shape=(3, 3, 64, 32))
          y = relay.nn.conv2d(
              x,
              weight1,
              channels=32,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="NHWC",
              kernel_layout="HWIO",
          )
          # z has no layout information so convert layout won't happen.
          z = relay.var("y", shape=(1, 56, 56, 32))
          out = relay.slice_like(y, z, axes=[1, 2])
          return relay.Function(analysis.free_vars(out), out)
  
      after = run_opt_pass(
          func_vars(),
          transform.ConvertLayout({"nn.conv2d": ["NCHW", "default"]}),
      )
      verify_slice_like(after, [1, 2])
  
imports: import pytest
  import tvm
  from tvm import relay, te
  from tvm.relay import analysis, transform
  from tvm.relay.op import op
  from tvm.relay.op import register_alter_op_layout
  from tvm.relay.quantize._annotate import attach_simulated_quantize, QAnnotateKind
  from tvm.relay.transform.infer_layout_utils import InferCorrectLayoutOutput
label_desc: Use image node_id 14 for calling a global function with example usage: test_slice_like_convert_layout() and returns: relay, relay, relay