code: def testAccumulatorTakeGradSum(self):
      with self.cached_session() as sess:
          q = data_flow_ops.SparseConditionalAccumulator(
              dtypes_lib.float32,
              name="Q",
              shape=(),
              reduction_type="SUM",
          )
  
          grad_indexed_slices = indexed_slices.IndexedSlices(
              indices=[0, 1],
              values=np.array([[1, 0], [0, 2]]).astype(np.float32),
          )
          accum_op = q.apply_indexed_slices_grad(grad_indexed_slices)
          accum_op.run()
          accum_op = q.apply_grad(
              [0, 2],
              np.array([[0, 1], [3, 0]]).astype(np.float32),
              [3, 2],
          )
          accum_op.run()
  
          takeg_t = q.take_indexed_slices_grad(1)
          val = self.evaluate(takeg_t)
          self.assertAllEqual([0, 1, 2], val.indices)
          self.assertAllEqual([[1, 1], [0, 2], [3, 0]], val.values)
          self.assertAllEqual([-1, 2], val.dense_shape)
  
imports: import time
  import numpy
  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 indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import data_flow_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 12 for calling the IndexedSlicesConditionalAccumulatorTest obj's underlying member method code with example usage: obj.testAccumulatorTakeGradSum() without return types