code: def _batch_norm(self, x, mean, var, offset, scale, epsilon):
      # We compute the batch norm manually in this function because
      # nn_impl.batch_normalization does not support float16 yet.
      # TODO(reedwm): Add float16 support to nn_impl.batch_normalization.
      inv = math_ops.rsqrt(var + epsilon) * scale
      y = math_ops.cast(x, scale.dtype) * inv + (offset - mean * inv)
      return math_ops.cast(y, x.dtype)
  
imports: import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_fused_batch_norm_grad
  from tensorflow.python.ops import nn_impl
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the BatchNormalizationTest obj's underlying member method code with example usage: obj._batch_norm(x, mean, var, offset, scale, epsilon) and returns: math_ops