code: def testSparseFillEmptyRowsGradMatrix(self):
      reverse_index_map = [0, 1]
      grad_values = [[0, 1], [2, 3]]
      # Note: Eager mode and graph mode throw different errors here. Graph mode
      # will fail with a ValueError from the shape checking logic, while Eager
      # will fail with an InvalidArgumentError from the kernel itself.
      if context.executing_eagerly():
          with self.assertRaisesRegex(
              errors.InvalidArgumentError,
              r"grad_values must be a vector",
          ):
              self.evaluate(
                  gen_sparse_ops.SparseFillEmptyRowsGrad(
                      reverse_index_map=reverse_index_map,
                      grad_values=grad_values,
                  )
              )
      else:
          with self.assertRaisesRegex(
              ValueError, r"Shape must be rank 1 but is rank 2"
          ):
              self.evaluate(
                  gen_sparse_ops.SparseFillEmptyRowsGrad(
                      reverse_index_map=reverse_index_map,
                      grad_values=grad_values,
                  )
              )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_grad
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_sparse_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import sparse_grad
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 4 for calling the RawOpsTest obj's underlying member method code with example usage: obj.testSparseFillEmptyRowsGradMatrix() without return types