code: def inverse_transform_stratified_1d(
      bin_start: TensorLike,
      bin_width: TensorLike,
      pdf: TensorLike,
      num_samples: int,
      name="inverse_transform_stratified_1d",
  ):
      """Stratified sampling 1D points from a distribution using the inverse transform.
  
        The target distrubution is defined by its probability density function and
        the spatial 1D location of its bins (start and width of each bin).
        The new samples can be sampled from anywhere inside the bin, unlike
        inverse_transform_sampling_1d that returns the selected bin location.
  
      Args:
        bin_start: A tensor of shape `[A1, ..., An, M]` containing starting position
          of M bins.
        bin_width: A tensor of shape `[A1, ..., An, M]` containing the width of
          M bins.
        pdf: A tensor of shape `[A1, ..., An, M]` containing the probability
          distribution in M bins.
        num_samples: The number N of new samples.
        name:  A name for this op that defaults to "inverse_transform_stratified".
  
      Returns:
        A tensor of shape `[A1, ..., An, N]` indicating the N points on the ray
      """
  
      with tf.name_scope(name):
          bin_start = tf.convert_to_tensor(value=bin_start)
          bin_width = tf.convert_to_tensor(value=bin_width)
          pdf = tf.convert_to_tensor(value=pdf)
  
          shape.check_static(
              tensor=bin_start,
              tensor_name="bin_start",
              has_rank_greater_than=0,
          )
          shape.check_static(
              tensor=bin_width,
              tensor_name="bin_width",
              has_rank_greater_than=0,
          )
          shape.check_static(
              tensor=pdf, tensor_name="pdf", has_rank_greater_than=0
          )
          shape.compare_batch_dimensions(
              tensors=(bin_start, pdf, bin_width),
              tensor_names=("bins", "pdf", "bin_width"),
              last_axes=-2,
              broadcast_compatible=True,
          )
          shape.compare_dimensions(
              tensors=(bin_start, pdf, bin_width),
              tensor_names=("bins", "pdf", "bin_width"),
              axes=-1,
          )
          # Do not consider the last bin, as the cdf contains has +1 dimension.
          pdf = _normalize_pdf(pdf[..., :-1])
          cdf = _get_cdf(pdf)
          batch_shape = tf.shape(pdf)[:-1]
          batch_dims = batch_shape.get_shape().as_list()[0]
          target_shape = tf.concat(
              [batch_shape, [num_samples]], axis=-1
          )
          uniform_samples = tf.random.uniform(target_shape)
          bin_indices = tf.searchsorted(
              cdf, uniform_samples, side="right"
          )
          below_bin_id = tf.maximum(0, bin_indices - 1)
          above_bin_id = tf.minimum(cdf.shape[-1] - 1, bin_indices)
          below_bin_cdf = tf.gather(
              cdf, below_bin_id, axis=-1, batch_dims=batch_dims
          )
          above_bin_cdf = tf.gather(
              cdf, above_bin_id, axis=-1, batch_dims=batch_dims
          )
          bin_prob = above_bin_cdf - below_bin_cdf
          bin_prob = tf.where(
              bin_prob < 1e-5, tf.ones_like(bin_prob), bin_prob
          )
          below_bin = tf.gather(
              bin_start, below_bin_id, axis=-1, batch_dims=batch_dims
          )
          bin_width = tf.gather(
              bin_width, below_bin_id, axis=-1, batch_dims=batch_dims
          )
          return (
              below_bin
              + (uniform_samples - below_bin_cdf) / bin_prob * bin_width
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import safe_ops
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util.type_alias import TensorLike
label_desc: Use image node_id 12 for calling a global function with example usage: inverse_transform_stratified_1d(bin_start, bin_width, pdf, num_samples, name) and returns: unknown