code: def testGradientsExplicit(self):
      sp_input = self._SparseTensor_4x6()
      start, size = [0, 0], [4, 1]
      sp_output = sparse_ops.sparse_slice(sp_input, start, size)
      input_grad_vals = sparse_ops.sparse_slice_grad(
          sp_output.values, sp_input.indices, start, sp_output.indices
      )
      # pyformat: disable
      self.assertAllEqual(
          input_grad_vals, [0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 30, 0, 0, 0]
      )
      # pyformat: enable
  
      start, size = [0, 1], [4, 1]
      sp_output = sparse_ops.sparse_slice(sp_input, start, size)
      input_grad_vals = sparse_ops.sparse_slice_grad(
          sp_output.values, sp_input.indices, start, sp_output.indices
      )
      # pyformat: disable
      self.assertAllEqual(
          input_grad_vals, [0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0]
      )
      # pyformat: enable
  
      start, size = [1, 3], [3, 1]
      sp_output = sparse_ops.sparse_slice(sp_input, start, size)
      input_grad_vals = sparse_ops.sparse_slice_grad(
          sp_output.values, sp_input.indices, start, sp_output.indices
      )
      # pyformat: disable
      self.assertAllEqual(
          input_grad_vals, [0, 0, 0, 0, 0, 13, 0, 0, 23, 0, 0, 0, 33, 0]
      )
      # pyformat: enable
  
      # Test empty slice of non-empty input.
      start, size = [2, 1], [2, 1]
      sp_output = sparse_ops.sparse_slice(sp_input, start, size)
      input_grad_vals = sparse_ops.sparse_slice_grad(
          sp_output.values, sp_input.indices, start, sp_output.indices
      )
      # pyformat: disable
      self.assertAllEqual(
          input_grad_vals, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
      )
      # pyformat: enable
  
      sp_input = self._SparseTensor_4x6_empty()
      start, size = [0, 0], [4, 1]
      sp_output = sparse_ops.sparse_slice(sp_input, start, size)
      input_grad_vals = sparse_ops.sparse_slice_grad(
          sp_output.values, sp_input.indices, start, sp_output.indices
      )
      self.assertAllEqual(input_grad_vals, [])
  
imports: import numpy
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import gen_sparse_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import sparse_ops
  import tensorflow.python.ops.sparse_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 14 for calling the SparseSliceOpTest obj's underlying member method code with example usage: obj.testGradientsExplicit() without return types