code: def test_combine_parallel_dense_flat_biasadd_scale_reshape():
      """Testcase of combining dense with different out dims
      following bias add, scale, reshape ops
      """
  
      def before(
          x, w1, w2, b1, b2, scale1, scale2, newshape1, newshape2
      ):
          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=newshape1)
          y2 = relay.reshape(y2, newshape=newshape2)
          y = relay.Tuple((y1, y2))
          return relay.Function(args, y)
  
      def expected(
          x, w1, w2, b1, b2, scale1, scale2, newshape1, newshape2, j
      ):
          args = [x, w1, w2, b1, b2, scale1, scale2]
          w_stacked = relay.concatenate((w1, w2), axis=0)
          y = relay.nn.dense(x, w_stacked, units=3 * j)
          b = relay.concatenate((b1, b2), axis=0)
          y = relay.add(y, b)
          scale1 = relay.repeat(scale1, j, 0)
          scale2 = relay.repeat(scale2, 2 * j, 0)
          scale = relay.concatenate((scale1, scale2), axis=0)
          y = relay.multiply(y, scale)
          strides = [1, 1]
          y1 = relay.strided_slice(
              y,
              begin=[0, 0],
              end=[-1, j],
              strides=strides,
              slice_mode="size",
          )
          y2 = relay.strided_slice(
              y,
              begin=[0, j],
              end=[-1, 2 * j],
              strides=strides,
              slice_mode="size",
          )
          y1 = relay.reshape(y1, newshape=newshape1)
          y2 = relay.reshape(y2, newshape=newshape2)
          y = relay.Tuple((y1, y2))
          return relay.Function(args, y)
  
      def check(i, j, k, scale1, scale2, newshape1, newshape2):
          x = relay.var("x", shape=(i, k))
          w1 = relay.var("w1", shape=(j, k))
          w2 = relay.var("w2", shape=(2 * j, k))
          b1 = relay.var("b1", shape=(j,))
          b2 = relay.var("b2", shape=(2 * j,))
          scale1 = relay.var("scale1", shape=(1,))
          scale2 = relay.var("scale2", shape=(1,))
  
          y_before = before(
              x, w1, w2, b1, b2, scale1, scale2, newshape1, newshape2
          )
          combine_pass = transform.CombineParallelDense(
              min_num_branches=2, to_batch=False
          )
          y = run_opt_pass(y_before, combine_pass)
          y_expected = expected(
              x, w1, w2, b1, b2, scale1, scale2, newshape1, newshape2, j
          )
          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), (1, 1, 30))
      check(100, 200, 300, 0.5, 0.25, (1, 1, 20000), (1, 1, 40000))
  
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 8 for calling a global function with example usage: test_combine_parallel_dense_flat_biasadd_scale_reshape() and returns: relay, relay