class_docstr: Test for cases in which enable_check_numerics() catches infs or nans.
class_docstr_tok: ["Test","for","cases","in","which","enable_check_numerics","(",")","catches","infs","or","nans","."]
docstr: Test calling operations with benign NaN output.
docstr_tok: ["Test","calling","operations","with","benign","NaN","output","."]
code: def testExpectedNaNOpOutputs(self):
      """Test calling operations with benign NaN output."""
      check_numerics_callback.enable_check_numerics()
  
      # Empty input tensor
      x = constant_op.constant(
          1, dtype=dtypes.float32, shape=[0, 1, 1, 1]
      )
      scale = constant_op.constant([1], dtype=dtypes.float32)
      offset = constant_op.constant([1], dtype=dtypes.float32)
  
      # Calling fused_batch_norm with an empty input should output a NaN in the
      # latter four outputs without triggering the check_numerics callback
      batch_norm_res = gen_nn_ops._fused_batch_norm(
          x=x, scale=scale, offset=offset, mean=[], variance=[]
      )
  
      _, batch_mean, batch_variance, _, _ = self.evaluate(
          batch_norm_res
      )
  
      self.assertTrue(np.isnan(batch_mean.squeeze()))
      self.assertTrue(np.isnan(batch_variance.squeeze()))
  
imports: import re
  import numpy
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.debug.lib import check_numerics_callback
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_grad
  from tensorflow.python.ops import custom_gradient
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import math_grad
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import googletest
  from tensorflow.python.platform import test
label_desc: Use image node_id 15 for calling the CheckNumericsCallbackUnhealthyTest obj's underlying member method code with example usage: obj.testExpectedNaNOpOutputs() without return types