code: def test_combine_parallel_dense_biasadd():
      """Testcase of combining dense + 1d biasadd"""
  
      def before(x, w1, w2, b1, b2):
          args = [x, w1, w2, b1, b2]
          y1 = relay.nn.dense(x, w1)
          y2 = relay.nn.dense(x, w2)
          y1 = relay.add(y1, b1)
          y2 = relay.add(y2, b2)
          y = relay.Tuple((y1, y2))
          return relay.Function(args, y)
  
      def expected(x, w1, w2, b1, b2, is_2d_bias):
          args = [x, w1, w2, b1, b2]
          x_stacked = relay.stack((x, x), axis=0)
          w = relay.stack((w1, w2), axis=0)
          y = relay.nn.batch_matmul(x_stacked, w)
  
          if not is_2d_bias:
              b1 = relay.expand_dims(b1, 0)
              b2 = relay.expand_dims(b2, 0)
  
          b = relay.stack((b1, b2), axis=0)
          y = relay.add(y, b)
          (y1, y2) = relay.split(y, 2)
          y1 = relay.squeeze(y1, [0])
          y2 = relay.squeeze(y2, [0])
          y = relay.Tuple((y1, y2))
          return relay.Function(args, y)
  
      def check(i, j, k, is_2d_bias):
          x = relay.var("x", shape=(i, k))
          w1 = relay.var("w1", shape=(j, k))
          w2 = relay.var("w2", shape=(j, k))
  
          if is_2d_bias:
              b1 = relay.var("b1", shape=(i, j))
              b2 = relay.var("b2", shape=(i, j))
          else:
              b1 = relay.var("b1", shape=(j,))
              b2 = relay.var("b2", shape=(j,))
  
          y_before = before(x, w1, w2, b1, b2)
          y = run_opt_pass(
              y_before,
              transform.CombineParallelDense(min_num_branches=2),
          )
          y_expected = expected(x, w1, w2, b1, b2, is_2d_bias)
          y_expected = run_opt_pass(y_expected, transform.InferType())
          tvm.ir.assert_structural_equal(
              y, y_expected, map_free_vars=True
          )
  
      check(3, 5, 4, False)
      check(100, 200, 300, False)
      check(3, 5, 4, True)
      check(100, 200, 300, True)
  
file_path: tvm/tests/python/relay/test_pass_combine_parallel_dense.py
imports: import tvm
  import tvm.testing
  from tvm import relay
  from tvm.relay import transform
label_desc: Use image node_id 4 for calling a global function with example usage: test_combine_parallel_dense_biasadd() and returns: relay, relay