code: def test_layer_norm(
      target,
      dev,
      shape,
      axis,
      episilon=1e-5,
      dtype="float32",
      rtol=1e-5,
      atol=1e-5,
  ):
      data = te.placeholder(shape, dtype=dtype, name="data")
      scale_shape = [shape[dim] for dim in axis]
      gamma = te.placeholder(scale_shape, dtype=dtype, name="gamma")
      beta = te.placeholder(scale_shape, dtype=dtype, name="beta")
      B = topi.nn.layer_norm(data, gamma, beta, axis, episilon)
  
      data_np = np.random.uniform(size=shape).astype(dtype)
      gamma_np = np.random.uniform(size=scale_shape).astype(dtype)
      beta_np = np.random.uniform(size=scale_shape).astype(dtype)
      b_np = tvm.topi.testing.layer_norm_python(
          data_np, gamma_np, beta_np, axis, episilon
      )
  
      with tvm.target.Target(target):
          s_func = tvm.topi.testing.dispatch(
              target, _layer_norm_schedule
          )
          s = s_func([B])
      data_tvm = tvm.nd.array(data_np, dev)
      gamma_tvm = tvm.nd.array(gamma_np, dev)
      beta_tvm = tvm.nd.array(beta_np, dev)
      b_tvm = tvm.nd.array(
          np.zeros(get_const_tuple(B.shape), dtype=dtype), dev
      )
      f = tvm.build(s, [data, gamma, beta, B], target)
      f(data_tvm, gamma_tvm, beta_tvm, b_tvm)
      tvm.testing.assert_allclose(
          b_tvm.numpy(), b_np, rtol=rtol, atol=atol
      )
  
file_path: tvm/tests/python/topi/test_topi_layer_norm.py
imports: import numpy
  import pytest
  import tvm
  from tvm import te
  from tvm import topi
  from tvm.topi.utils import get_const_tuple
  import tvm.topi.testing
  import tvm.testing
label_desc: Use image node_id 1 for calling a global function with example usage: test_layer_norm(target, dev, shape, axis, episilon, dtype, rtol, atol) without return types