docstr: Test cross-entropy on logits with sparse integer label.
docstr_tok: ["Test","cross-entropy","on","logits","with","sparse","integer","label","."]
code: def test_on_xe_logits_sparse_integer_label(self):
      """Test cross-entropy on logits with sparse integer label."""
      x = jn.array(
          [
              [0.58, 0.4, 0.02],
              [0.36, 0.27, 0.37],
              [0.46, 0.24, 0.3],
              [0.35, 0.29, 0.36],
          ]
      )
      y = 2
      e = objax.functional.loss.cross_entropy_logits_sparse(10 * x, y)
      gold = jn.array([5.756146, 0.820976, 1.8720856, 0.8760612])
      self.assertAlmostEqual(
          jn.abs(e - gold).sum(), 0, delta=ERROR_TOLERANCE
      )
  
file_path: objax/tests/loss.py
imports: import unittest
  import jax.numpy
  import objax
label_desc: Use image node_id 10 for calling the TestLoss obj's underlying member method code with example usage: obj.test_on_xe_logits_sparse_integer_label() without return types