class_docstr: Test that SparseSoftmaxCrossEntropyWithLogits operates reproducibly.
  
  Inheriting from sparse_xent_op_test_base.SparseXentOpTestBase ensures that
  regular op functionality is correct when the deterministic code-path is
  selected.
  
  Note that because nn_ops.sparse_softmax_cross_entropy_with_logits_v2 calls
  nn_ops.sparse_softmax_cross_entropy_with_logits directly, the focus of
  testing is on the former in order to test both.
class_docstr_tok: ["Test","that","SparseSoftmaxCrossEntropyWithLogits","operates","reproducibly",".","Inheriting","from","sparse_xent_op_test_base.SparseXentOpTestBase","ensures","that","regular","op","functionality","is","correct","when","the","deterministic","code-path","is","selected",".","Note","that","because","nn_ops.sparse_softmax_cross_entropy_with_logits_v2","calls","nn_ops.sparse_softmax_cross_entropy_with_logits","directly",",","the","focus","of","testing","is","on","the","former","in","order","to","test","both","."]
docstr: Modified test for invalid labels on GPU.
  
  When running on GPU, the pre-existing, nondeterministic implementation
  produces NaN (in both the forward and backward directions) for results
  associated with invalid labels (less than zero or greater than the number of
  classes minus one). However, while the deterministic implementation also
  produces NaN in the forward direction, it produces zeros in the backward
  direction.
docstr_tok: ["Modified","test","for","invalid","labels","on","GPU",".","When","running","on","GPU",",","the","pre-existing",",","nondeterministic","implementation","produces","NaN","(","in","both","the","forward","and","backward","directions",")","for","results","associated","with","invalid","labels","(","less","than","zero","or","greater","than","the","number","of","classes","minus","one",")",".","However",",","while","the","deterministic","implementation","also","produces","NaN","in","the","forward","direction",",","it","produces","zeros","in","the","backward","direction","."]
code: def testInvalidLabelGPU(self):
      """Modified test for invalid labels on GPU.
  
      When running on GPU, the pre-existing, nondeterministic implementation
      produces NaN (in both the forward and backward directions) for results
      associated with invalid labels (less than zero or greater than the number of
      classes minus one). However, while the deterministic implementation also
      produces NaN in the forward direction, it produces zeros in the backward
      direction.
      """
      self._testInvalidLabelGPU(invalid_label_gradient=0.0)
  
imports: 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.kernel_tests.sparse_ops import sparse_xent_op_test_base
  from tensorflow.python.ops.nn_grad import _SparseSoftmaxCrossEntropyWithLogitsGrad
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 6 for calling the SparseXentOpDeterministicTest obj's underlying member method code with example usage: obj.testInvalidLabelGPU() without return types