code: def get_distances_between_points(ray_points3d, last_bin_width=1e10):
      """Estimates the distance between points in a ray.
  
      Args:
        ray_points3d: A tensor of shape `[A1, ..., An, M, 3]`,
          where M is the number of points in a ray.
        last_bin_width: A scalar indicating the witdth of the last bin.
  
      Returns:
        A tensor of shape `[A1, ..., An, M]` containing the distances between
          the M points, with the distance of the last element set to a high value.
      """
      shape.check_static(
          tensor=ray_points3d,
          tensor_name="ray_points3d",
          has_dim_equals=(-1, 3),
      )
      shape.check_static(
          tensor=ray_points3d,
          tensor_name="ray_points3d",
          has_rank_greater_than=1,
      )
      dists = tf.norm(
          ray_points3d[..., 1:, :] - ray_points3d[..., :-1, :], axis=-1
      )
      if last_bin_width > 0.0:
          dists = tf.concat(
              [
                  dists,
                  tf.broadcast_to(
                      [last_bin_width], dists[..., :1].shape
                  ),
              ],
              axis=-1,
          )
      return dists
  
file_path: graphics/tensorflow_graphics/projects/radiance_fields/utils.py
imports: import math
  import tensorflow
  from tensorflow_graphics.geometry.transformation import rotation_matrix_3d
  from tensorflow_graphics.util import shape
label_desc: Use image node_id 3 for calling a global function with example usage: get_distances_between_points(ray_points3d, last_bin_width) and returns: dists