code: def _finite_differences(sums):
      """The inverse of `tf.cumsum` with `axis=-1`."""
      return ps.concat(
          [sums[..., :1], sums[..., 1:] - sums[..., :-1]], axis=-1
      )
  
file_path: probability/tensorflow_probability/python/experimental/mcmc/weighted_resampling.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math.gradient import value_and_gradient
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 7 for calling a global function with example usage: _finite_differences(sums) and returns: ps