code: def testEmptyShapeApply(self):
      with self.cached_session():
          q = data_flow_ops.SparseConditionalAccumulator(
              dtypes_lib.float32,
              name="Q",
              shape=tensor_shape.TensorShape([]),
          )
  
          with self.assertRaisesRegex(
              errors_impl.InvalidArgumentError,
              "Input indices should be vector",
          ):
              q.apply_grad(
                  grad_indices=0, grad_values=[1.0], grad_shape=[]
              ).run()
  
          with self.assertRaisesRegex(
              errors_impl.InvalidArgumentError,
              "Input indices should be vector",
          ):
              q.apply_grad(grad_indices=0, grad_values=[1.0]).run()
  
          with self.assertRaisesRegex(
              errors_impl.InvalidArgumentError,
              "Values cannot be 0-dimensional.",
          ):
              q.apply_grad(
                  grad_indices=[0], grad_values=1.0, grad_shape=[]
              ).run()
  
          with self.assertRaisesRegex(
              errors_impl.InvalidArgumentError,
              "Values cannot be 0-dimensional.",
          ):
              q.apply_grad(grad_indices=[0], grad_values=1.0).run()
  
          # The right way to apply a scalar
          q.apply_grad(
              grad_indices=[0], grad_values=[1.0], grad_shape=[]
          ).run()
          q.apply_grad(grad_indices=[0], grad_values=[1.0]).run()
  
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 26 for calling the IndexedSlicesConditionalAccumulatorTest obj's underlying member method code with example usage: obj.testEmptyShapeApply() without return types