class_docstr: A collection of tensors encoding the shape of a potentially ragged tensor.
  
  Each `RaggedTensorDynamicShape` consists of an ordered list of dimension
  sizes.  There are two dimension types:
  
    * "Uniform dimensions" are dimensions where all slices have the same
      length.  `RaggedTensorDynamicShape` records the size of each uniform
      dimension using a single scalar integer.
  
    * "Ragged dimensions" are dimensions whose slices may have different
      lengths.  `RaggedTensorDynamicShape` records the size of each ragged
      dimension using an integer vector containing the slice lengths for all
      the slices across that dimension.
  
  Furthermore, there are two ways a dimension might be encoded:
  
    * "Partitioned dimensions" are dimensions that are encoded using a
      `RaggedTensor`'s `nested_row_splits`.  The outermostmost partitioned
      dimension must be uniform, and the innermost partitioned dimension must
      be ragged.
  
    * "Inner dimensions" are dimensions that are encoded using a
      `RaggedTensor`'s `flat_values`.  Inner dimensions are always uniform.
  
  The sizes of partitioned dimensions are recorded using `partitioned_dim_sizes`
  and `inner_dim_sizes`:
  
    * `partitioned_dim_sizes` is a list of tensors (one for each partitioned
      dimension).
  
      * For uniform dimensions, the tensor is an integer scalar specifying the
        size of all slices across that dimension.
      * For ragged dimensions, the tensor is an integer vector specifying the
        size of each slice across that dimension.
  
    * `inner_dim_sizes` is a single integer vector, where each element
      specifies the size of a single inner dimension.
  
  Examples:
  
  Tensor                         | Ragged | Partitioned Dim Sizes  | Inner Dim
                                 : Rank   :                        : Sizes
  ------------------------------ | ------ | ---------------------- | ----------
  `[[1, 2, 3], [4, 5, 6]]`       |      0 |                        | `2, 3`
  `[[1, 2], [], [3, 4, 5]]`      |      1 | `3, (2, 0, 3)`         |
  `[[[1, 2], [3, 4]], [[5, 6]]]` |      1 | `2, (2, 1)`            | 2
  `[[[1, 2], [3]], [[4, 5]]]`    |      2 | `2, (2, 1), (2, 1, 2)` |
docstr: Returns a shape that is broadcast-compatible with self & lengths.
  
  * If dimension[axis] is uniform and lengths is a scalar, the check
    that either lengths==1 or axis==1 or lengths==axis, and tile
    dimension[axis] with tf.where(lengths==axis, 1, axis) repeats.
  
  * If dimension[axis] is uniform and lengths is a vector, then check
    that dimension[axis]==1, and raggedly tile dimension[axis] with
    lengths repeats.  (we can skip tiling if we statically know that
    slice_lengths == 1??)
  
  * If dimension[axis] is ragged and lengths is a scalar, then check
    that lengths==1.
  
  * If dimension[axis] is ragged and lengths is a vector, then check
    that self.dimension_size(axis) == lengths.
  
  Args:
    axis: `int`.  The dimension to broadcast.
    lengths: 0-D or 1-D integer `Tensor`.
  
  Returns:
    A `RaggedTensorDynamicShape`.
code: def broadcast_dimension(self, axis, lengths):
      """Returns a shape that is broadcast-compatible with self & lengths.
  
      * If dimension[axis] is uniform and lengths is a scalar, the check
        that either lengths==1 or axis==1 or lengths==axis, and tile
        dimension[axis] with tf.where(lengths==axis, 1, axis) repeats.
  
      * If dimension[axis] is uniform and lengths is a vector, then check
        that dimension[axis]==1, and raggedly tile dimension[axis] with
        lengths repeats.  (we can skip tiling if we statically know that
        slice_lengths == 1??)
  
      * If dimension[axis] is ragged and lengths is a scalar, then check
        that lengths==1.
  
      * If dimension[axis] is ragged and lengths is a vector, then check
        that self.dimension_size(axis) == lengths.
  
      Args:
        axis: `int`.  The dimension to broadcast.
        lengths: 0-D or 1-D integer `Tensor`.
  
      Returns:
        A `RaggedTensorDynamicShape`.
      """
      lengths = ragged_util.convert_to_int_tensor(
          lengths, name="lengths", dtype=self.dim_size_dtype
      )
      # Check whether lengths is a scalar (for uniform dimensions) or
      # vector (for ragged dimensions).
      if lengths.shape.ndims is None:
          raise ValueError("lengths must have a known rank.")
      elif lengths.shape.ndims > 1:
          raise ValueError("lengths must be a scalar or vector")
      else:
          lengths_is_scalar = lengths.shape.ndims == 0
  
      # Verify that the shapes are compatible.
      if self.is_ragged(axis):
          if lengths_is_scalar:
              condition = math_ops.equal(lengths, 1)
          else:
              condition = math_ops.reduce_all(
                  math_ops.equal(lengths, self.dimension_size(axis))
              )
      else:
          axis_dim_size = self.dimension_size(axis)
          if lengths_is_scalar:
              condition = (
                  math_ops.equal(lengths, 1)
                  | math_ops.equal(axis_dim_size, 1)
                  | math_ops.equal(axis_dim_size, lengths)
              )
          else:
              condition = math_ops.equal(axis_dim_size, 1)
      broadcast_err = [
          "Unable to broadcast: dimension size mismatch in dimension",
          axis,
          "lengths=",
          lengths,
          "dim_size=",
          self.dimension_size(axis),
      ]
      broadcast_check = control_flow_assert.Assert(
          condition, data=broadcast_err, summarize=10
      )
  
      with ops.control_dependencies([broadcast_check]):
          # Partitioned dimensions:
          if axis < self.num_partitioned_dimensions:
              if self.is_ragged(axis):
                  # Use an identity op to make sure the check actually gets run.
                  return RaggedTensorDynamicShape(
                      self._partitioned_dim_sizes,
                      array_ops.identity(self.inner_dim_sizes),
                      self.dim_size_dtype,
                  )
              else:
                  return self._broadcast_uniform_partitioned_dimension(
                      axis, lengths
                  )
  
          # Inner dimensions:
          else:
              if lengths_is_scalar:
                  return self._broadcast_inner_dimension_to_uniform(
                      axis, lengths
                  )
              else:
                  if axis == 0:
                      raise ValueError(
                          "Unable to broadcast: "
                          "outermost dimension must be uniform."
                      )
                  return self._broadcast_inner_dimension_to_ragged(
                      axis, lengths
                  )
  
imports: from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import control_flow_assert
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.ragged import ragged_array_ops
  from tensorflow.python.ops.ragged import ragged_config
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.ops.ragged import ragged_util
label_desc: Use image node_id 14 for calling the RaggedTensorDynamicShape obj's underlying member method code with example usage: obj.broadcast_dimension(axis, lengths) and returns: RaggedTensorDynamicShape, self, self, self