code: def test_split_concat(target_name, shape_type):
      if shape_type == "dynamic":
          shape = (tvm.tir.Any(), 1, 1, 3)
          number_of_any_dims = 1
      else:
          shape = (1, 1, 1, 3)
          number_of_any_dims = 0
      ndims = len(shape)
      dtype = "float32"
      axis = 1
      tensors_num = 300
      inputs = []
      for i in range(tensors_num):
          inputs.append(
              relay.var("p{}".format(i), shape=shape, dtype=dtype)
          )
  
      def before():
          inp = relay.Tuple(inputs)
          return relay.op.concatenate(inp, axis)
  
      def expected(limit):
          if limit == 0:
              return before()
          limit = limit - 1  # one buffer with output
          if number_of_any_dims > 0:
              limit -= ndims
  
          new_args = []
          added_args = 0
          num_inputs = 0
          for inp in inputs:
              curr_args = 1 + number_of_any_dims
              if number_of_any_dims > 0:
                  curr_args += ndims
              num_inputs += curr_args
              if added_args + curr_args > limit:
                  t = relay.Tuple(new_args)
                  stop = relay.annotation.stop_fusion(t)
                  concat = relay.op.concatenate(stop, axis)
                  new_args = [concat]
                  added_args = curr_args
              added_args += curr_args
              new_args.append(inp)
          t = relay.Tuple(new_args)
          stop = relay.annotation.stop_fusion(t)
          concat = relay.op.concatenate(stop, axis)
  
          if num_inputs < limit:
              return before()
  
          return concat
  
      # the fold constant should work on any context.
      limit = tvm.target.Target(target_name).max_function_args
      res = run_opt_pass(before(), transform.SplitArgs(limit))
      exp = run_opt_pass(expected(limit), transform.InferType())
      assert tvm.ir.structural_equal(res, exp)
  
file_path: tvm/tests/python/relay/test_pass_split_args.py
imports: import numpy
  import tvm
  from tvm import relay
  from tvm.relay import transform
  from tvm.relay.build_module import bind_params_by_name
  from tvm.relay.testing import run_infer_type, create_workload
label_desc: Use image node_id 2 for calling a global function with example usage: test_split_concat(target_name, shape_type) and returns: relay, concat, before, before