code: def test_batch_norm():
      for dtype in ["float16", "float32"]:
          # beta and gamma ignored
          data = relay.var("data", relay.TensorType((3, 2, 1), dtype))
          beta = relay.var("beta", relay.TensorType((2,), dtype))
          gamma = relay.var("gamma", relay.TensorType((2,), dtype))
          moving_mean = relay.var(
              "moving_mean", relay.TensorType((2,), dtype)
          )
          moving_var = relay.var(
              "moving_var", relay.TensorType((2,), dtype)
          )
          y = relay.nn.batch_norm(
              data,
              gamma,
              beta,
              moving_mean,
              moving_var,
              center=False,
              scale=False,
          )
          yy = run_infer_type(y.astuple())
          assert "center=" in yy.astext()
          assert yy.checked_type == relay.ty.TupleType(
              tvm.runtime.convert(
                  [
                      relay.TensorType((3, 2, 1), dtype),
                      relay.TensorType((2,), dtype),
                      relay.TensorType((2,), dtype),
                  ]
              )
          )
  
          # axis=1
          beta = relay.var("beta", relay.TensorType((3,), dtype))
          gamma = relay.var("gamma", relay.TensorType((3,), dtype))
          moving_mean = relay.var(
              "moving_mean", relay.TensorType((3,), dtype)
          )
          moving_var = relay.var(
              "moving_var", relay.TensorType((3,), dtype)
          )
  
          y = relay.nn.batch_norm(
              data,
              gamma,
              beta,
              moving_mean,
              moving_var,
              axis=0,
              center=False,
              scale=False,
          )
          yy = run_infer_type(y.astuple())
          assert yy.checked_type == relay.ty.TupleType(
              tvm.runtime.convert(
                  [
                      relay.ty.TensorType((3, 2, 1), dtype),
                      relay.ty.TensorType((3,), dtype),
                      relay.ty.TensorType((3,), dtype),
                  ]
              )
          )
  
          # axis=-1
          data = relay.var("data", relay.TensorType((1, 2, 3), dtype))
          beta = relay.var("beta", relay.TensorType((3,), dtype))
          gamma = relay.var("gamma", relay.TensorType((3,), dtype))
          moving_mean = relay.var(
              "moving_mean", relay.TensorType((3,), dtype)
          )
          moving_var = relay.var(
              "moving_var", relay.TensorType((3,), dtype)
          )
          y = relay.nn.batch_norm(
              data,
              gamma,
              beta,
              moving_mean,
              moving_var,
              axis=-1,
              center=False,
              scale=False,
          )
          yy = run_infer_type(y.astuple())
          assert yy.checked_type == relay.ty.TupleType(
              tvm.runtime.convert(
                  [
                      relay.ty.TensorType((1, 2, 3), dtype),
                      relay.ty.TensorType((3,), dtype),
                      relay.ty.TensorType((3,), dtype),
                  ]
              )
          )
  
imports: import numpy
  import pytest
  import tvm
  from tvm import te
  import scipy
  from tvm import relay
  import pytest
  from tvm.relay.testing import run_infer_type
  import tvm.topi.testing
  from tvm.contrib.nvcc import have_fp16
  import tvm.testing
  from tvm.topi.utils import get_const_tuple
label_desc: Use image node_id 13 for calling a global function with example usage: test_batch_norm() without return types