code: def test_dense():
      device = Device()
      np.random.seed(0)
  
      dtype = ["float32"]
      shape = [
          ((1, 128), (16, 128), 16),
          ((32, 32), (32, 32), 32),
          ((1, 64), (1, 64), 1),
          ((11, 2), (2, 2), 2),
          ((2, 2), (1, 2), 1),
      ]
      composite = [False, True]
      trials = generate_trials([dtype, shape, composite, composite], 3)
  
      for (
          dtype,
          (shape, weight_shape, units),
          with_bias,
          with_gelu,
      ) in trials:
          outputs = []
          inputs = {
              "a": tvm.nd.array(
                  np.random.uniform(-128, 127, shape).astype(dtype)
              )
          }
          func, params = _get_model(
              shape,
              weight_shape,
              units,
              dtype,
              var_names=iter(inputs),
              has_bias=with_bias,
              has_gelu=with_gelu,
          )
          for bnns in [False, True]:
              outputs.append(
                  build_and_run(
                      func,
                      inputs,
                      1,
                      params,
                      device,
                      enable_bnns=bnns,
                  )[0]
              )
  
          config = {
              "shape": shape,
              "weight_shape": weight_shape,
              "units": units,
              "dtype": dtype,
              "with_bias": with_bias,
              "with_gelu": with_gelu,
          }
          verify(outputs, atol=0.001, rtol=0.01, config=config)
  
file_path: tvm/tests/python/contrib/test_bnns/test_dense.py
imports: import numpy
  import math
  import pytest
  import tvm
  from tvm import relay
  from .infrastructure import Device, skip_runtime_test, skip_codegen_test, build_and_run, verify, verify_codegen, generate_trials
label_desc: Use image node_id 3 for calling a global function with example usage: test_dense() without return types