class_docstr: Computes the cumulative sum of a tensor along a specified axis.
  
  If `axis` is not provided, the default uses the rightmost dimension, i.e.,
  axis=-1.
  
  #### Example
  
  ```python
  x = tfb.Cumsum()
  
  x.forward([[1., 1.],
             [2., 2.],
             [3., 3.]])
  # ==> [[1., 2.],
         [2., 4.],
         [3., 6.]]
  
  x = tfb.Cumsum(axis=-2)
  
  x.forward([[1., 1.],
             [2., 2.],
             [3., 3.]])
  # ==> [[1., 1.],
         [3., 3.],
         [6., 6.]]
  ```
code: def _inverse(self, y):
      ndims = ps.rank(y)
      shifted_y = ps.pad(
          ps.slice(
              y,
              ps.zeros(ndims, dtype=tf.int32),
              ps.shape(y)
              - ps.one_hot(ndims + self.axis, ndims, dtype=tf.int32),
          ),  # Remove the last entry of y in the chosen dimension.
          paddings=ps.one_hot(
              ps.one_hot(
                  ndims + self.axis, ndims, on_value=0, off_value=-1
              ),
              2,
              dtype=tf.int32,
          ),  # Insert zeros at the beginning of the chosen dimension.
      )
  
      return y - shifted_y
  
file_path: probability/tensorflow_probability/python/bijectors/cumsum.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 5 for calling the Cumsum obj's underlying member method code with example usage: obj._inverse(y) and returns: unknown