code: def testSingleClass(self):
      for label_dtype in np.int32, np.int64:
          tf_loss, tf_gradient = self._opFwdBwd(
              labels=np.array([0, 0, 0]).astype(label_dtype),
              logits=np.array([[1.0], [-1.0], [0.0]]).astype(
                  np.float32
              ),
          )
          self.assertAllClose([0.0, 0.0, 0.0], tf_loss)
          self.assertAllClose([[0.0], [0.0], [0.0]], tf_gradient)
  
imports: import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  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 ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import nn_ops
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the SparseXentOpTestBase obj's underlying member method code with example usage: obj.testSingleClass() without return types