code: def test_combine_parallel_dense_biasadd_scale_reshape():
      """Testcase of combining dense + 1d biasadd + multiply with non-fused reshape"""
  
      def before(x, w1, w2, b1, b2, scale1, scale2, newshape):
          args = [x, w1, w2, b1, b2, scale1, scale2]
          y1 = relay.nn.dense(x, w1)
          y2 = relay.nn.dense(x, w2)
          y1 = relay.add(y1, b1)
          y2 = relay.add(y2, b2)
          y1 = relay.multiply(y1, scale1)
          y2 = relay.multiply(y2, scale2)
          y1 = relay.reshape(y1, newshape=newshape)
          y2 = relay.reshape(y2, newshape=newshape)
          y = relay.Tuple((y1, y2))
          return relay.Function(args, y)
  
      def expected(x, w1, w2, b1, b2, scale1, scale2, newshape):
          args = [x, w1, w2, b1, b2, scale1, scale2]
          x_stacked = relay.stack((x, x), axis=0)
          w = relay.stack((w1, w2), axis=0)
          y = relay.nn.batch_matmul(x_stacked, w)
          b1 = relay.expand_dims(b1, 0)
          b2 = relay.expand_dims(b2, 0)
          b = relay.stack((b1, b2), axis=0)
          y = relay.add(y, b)
          scale1 = relay.expand_dims(scale1, 0)
          scale2 = relay.expand_dims(scale2, 0)
          scale = relay.stack((scale1, scale2), axis=0)
          y = relay.multiply(y, scale)
          (y1, y2) = relay.split(y, 2)
          y1 = relay.squeeze(y1, [0])
          y2 = relay.squeeze(y2, [0])
          y1 = relay.reshape(y1, newshape=newshape)
          y2 = relay.reshape(y2, newshape=newshape)
          y = relay.Tuple((y1, y2))
          return relay.Function(args, y)
  
      def check(i, j, k, scale1, scale2, newshape):
          x = relay.var("x", shape=(i, k))
          w1 = relay.var("w1", shape=(j, k))
          w2 = relay.var("w2", shape=(j, k))
          b1 = relay.var("b1", shape=(j,))
          b2 = relay.var("b2", shape=(j,))
          scale1 = relay.var("scale1", shape=(1,))
          scale2 = relay.var("scale2", shape=(1,))
  
          y_before = before(x, w1, w2, b1, b2, scale1, scale2, newshape)
          y = run_opt_pass(
              y_before,
              transform.CombineParallelDense(min_num_branches=2),
          )
          y_expected = expected(
              x, w1, w2, b1, b2, scale1, scale2, newshape
          )
          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, 0.5, 0.25, (1, 1, 15))
      check(100, 200, 300, 0.5, 0.25, (1, 1, 20000))
  
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 5 for calling a global function with example usage: test_combine_parallel_dense_biasadd_scale_reshape() and returns: relay, relay