code: def test_tuple():
      target = "test_tuple"
  
      @tvm.ir.register_op_attr("nn.relu", "target." + target)
      def relu(expr):  # pylint: disable=unused-variable
          return True
  
      @tvm.ir.register_op_attr("concatenate", "target." + target)
      def concatenate(expr):  # pylint: disable=unused-variable
          return True
  
      """Test that TupleNode is included in annotation when surrounded by supported nodes."""
  
      def before():
          x = relay.var("x", shape=(10, 5))
          y = relay.var("y", shape=(10, 5))
          a_1 = relay.nn.relu(x)
          a_2 = relay.nn.relu(y)
          out = relay.concatenate((a_1, a_2), axis=1)
          f = relay.Function([x, y], out)
          mod = tvm.IRModule.from_expr(f)
          return mod
  
      def after(annotate_non_call_ops):
          x = relay.var("x", shape=(10, 5))
          y = relay.var("y", shape=(10, 5))
          cb_1 = relay.annotation.compiler_begin(x, target)
          cb_2 = relay.annotation.compiler_begin(y, target)
          a_1 = relay.nn.relu(cb_1)
          a_2 = relay.nn.relu(cb_2)
          ce_1 = relay.annotation.compiler_end(a_1, target)
          ce_2 = relay.annotation.compiler_end(a_2, target)
  
          if annotate_non_call_ops:
              cb_3 = relay.annotation.compiler_begin(ce_1, target)
              cb_4 = relay.annotation.compiler_begin(ce_2, target)
              tup = relay.Tuple([cb_3, cb_4])
              ce_3 = relay.annotation.compiler_end(tup, target)
          else:
              ce_3 = relay.Tuple([ce_1, ce_2])
  
          cb_3 = relay.annotation.compiler_begin(ce_3, target)
          out = relay.op._make.concatenate(cb_3, 1)
          ce_4 = relay.annotation.compiler_end(out, target)
          f = relay.Function([x, y], ce_4)
          mod = tvm.IRModule.from_expr(f)
          return mod
  
      for annotate_non_call_ops in [False, True]:
          result = transform.AnnotateTarget(
              target, annotate_non_call_ops
          )(before())
          expected = transform.InferType()(after(annotate_non_call_ops))
          assert tvm.ir.structural_equal(expected, result)
  
imports: import os
  import sys
  import numpy
  import pytest
  import tvm
  import tvm.relay.testing
  import tvm.relay.transform
  from tvm import relay
  from tvm import runtime
  from tvm.contrib import utils
label_desc: Use image node_id 7 for calling a global function with example usage: test_tuple() and returns: True, True, mod, mod