code: def test_fold_fwd_dense():
      """dense testcase."""
  
      def before(x, weight, in_bias, in_scale):
          args = [x, weight, in_bias]
          x = relay.multiply(x, in_scale)
          x = relay.nn.relu(x)
          x = relay.add(x, in_bias)
          y = relay.nn.dense(x, weight)
          return relay.Function(args, y)
  
      def expected(x, weight, in_bias, in_scale):
          # use a fixed order of args so alpha equal check can pass
          args = [x, weight, in_bias]
          x = relay.nn.relu(x)
          in_bias = relay.divide(in_bias, in_scale)
          x = relay.add(x, in_bias)
          weight = relay.multiply(weight, in_scale)
          y = relay.nn.dense(x, weight)
          return relay.Function(args, y)
  
      def check(data_shape, weight_shape):
          x = relay.var("x", shape=data_shape)
          weight = relay.var("weight", shape=weight_shape)
          in_channels = data_shape[1]
          in_bias = relay.var("in_bias", shape=(in_channels,))
          in_scale = relay.const(_get_positive_scale((in_channels,)))
          y1 = before(x, weight, in_bias, in_scale)
          y1 = run_opt_pass(y1, transform.InferType())
          y1_folded = run_opt_pass(y1, transform.ForwardFoldScaleAxis())
          y1_expected = expected(x, weight, in_bias, in_scale)
  
          y1_folded = run_opt_pass(y1_folded, transform.InferType())
          y1_expected = run_opt_pass(y1_expected, transform.InferType())
          assert tvm.ir.structural_equal(y1_folded, y1_expected)
  
      check((2, 4), (3, 4))
      check((3, 5), (4, 5))
  
imports: import numpy
  import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay import transform
  from tvm.relay.testing import create_workload
  from tvm.relay.build_module import bind_params_by_name
label_desc: Use image node_id 10 for calling a global function with example usage: test_fold_fwd_dense() and returns: relay, relay