code: def _testInvalidLabelCPU(
      self, expected_regex="Received a label value of"
  ):
      labels = [4, 3, 0, -1]
      logits = [
          [1.0, 1.0, 1.0, 1.0],
          [1.0, 1.0, 1.0, 1.0],
          [1.0, 2.0, 3.0, 4.0],
          [1.0, 2.0, 3.0, 4.0],
      ]
      with self.assertRaisesRegex(
          (errors_impl.InvalidArgumentError, errors_impl.UnknownError),
          expected_regex,
      ):
          self.evaluate(
              nn_ops.sparse_softmax_cross_entropy_with_logits_v2(
                  labels=labels, logits=logits
              )
          )
  
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 7 for calling the SparseXentOpTestBase obj's underlying member method code with example usage: obj._testInvalidLabelCPU(expected_regex) without return types