class_docstr: Test determinsitic functionality and exceptions for FusedBatchNorm.
  
  Test that tf.errors.UnimplementedError is thrown, as
  appropriate, by the GPU code-path through FusedBatchNormFreezeGrad when
  deterministic ops are enabled. This test assumes that
  nn_fused_batchnorm_test.py runs equivalent test cases when deterministic ops
  are not enabled and will therefore detect erroneous exception throwing in
  those cases.
  
  Also test that the other code-paths, running on both CPU and GPU, operate
  deterministically.
class_docstr_tok: ["Test","determinsitic","functionality","and","exceptions","for","FusedBatchNorm",".","Test","that","tf.errors.UnimplementedError","is","thrown",",","as","appropriate",",","by","the","GPU","code-path","through","FusedBatchNormFreezeGrad","when","deterministic","ops","are","enabled",".","This","test","assumes","that","nn_fused_batchnorm_test.py","runs","equivalent","test","cases","when","deterministic","ops","are","not","enabled","and","will","therefore","detect","erroneous","exception","throwing","in","those","cases",".","Also","test","that","the","other","code-paths",",","running","on","both","CPU","and","GPU",",","operate","deterministically","."]
code: def testForward(self, data_format):
      with self.cached_session():
          for large_batch in [False, True]:
              for x_dtype in [
                  dtypes.float16,
                  dtypes.float32,
              ]:  # skipping bfloat16
                  x, scale, offset, mean, variance, _ = self._genParams(
                      data_format, x_dtype, large_batch
                  )
                  for is_training in [False, True]:
                      op_output = nn_impl.fused_batch_norm(
                          x,
                          scale,
                          offset,
                          mean,
                          variance,
                          data_format=data_format,
                          is_training=is_training,
                          exponential_avg_factor=1.01,
                      )
                      y_a, running_mean_a, running_var_a = op_output
                      y_a = self.evaluate(y_a)
                      if is_training:
                          running_mean_a = self.evaluate(running_mean_a)
                          running_var_a = self.evaluate(running_var_a)
                      for _ in range(5):
                          op_output_b = nn_impl.fused_batch_norm(
                              x,
                              scale,
                              offset,
                              mean,
                              variance,
                              data_format=data_format,
                              is_training=is_training,
                              exponential_avg_factor=1.01,
                          )
                          (
                              y_b,
                              running_mean_b,
                              running_var_b,
                          ) = op_output_b
                          y_b = self.evaluate(y_b)
                          self.assertAllEqual(y_a, y_b)
                          if is_training:
                              running_mean_b = self.evaluate(
                                  running_mean_b
                              )
                              running_var_b = self.evaluate(
                                  running_var_b
                              )
                              self.assertAllEqual(
                                  running_mean_a, running_mean_b
                              )
                              self.assertAllEqual(
                                  running_var_a, running_var_b
                              )
  
file_path: tensorflow/tensorflow/python/ops/nn_fused_batchnorm_d9m_test.py
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import config
  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 nn_impl
  from tensorflow.python.ops.nn_grad import _FusedBatchNormV3Grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the FusedBatchNormalizationDeterministicTest obj's underlying member method code with example usage: obj.testForward(data_format) without return types