Language: Python
Label: safe
CWE: CWE-476 \u2014 NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.

Code:
  def testInvalidSparseInputs(self):
    with test_util.force_cpu():
      with self.assertRaisesRegex(
          (ValueError, errors.InvalidArgumentError),
          ".*Index rank .* and shape rank .* do not match.*",
      ):
        self.evaluate(
            gen_sparse_ops.sparse_sparse_maximum(
                [[1]], [0], [2], [[]], [1], [2]
            )
        )