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: Adds leading size-1 dimensions to broadcast `self` to the given rank.
  
  E.g., if `shape1` is `[3, (D2), 4]`, then `shape1.broadcast_to_rank(5)`
  is `[1, 1, 3, (D2), 4]`.
  
  Args:
    rank: The rank for the returned shape.
  
  Returns:
    A RaggedTensorDynamicShape with `rank` dimensions, whose inner dimensions
    have the same size as `self` and whose outer dimensions have size `1`.
  
  Raises:
    ValueError: If `self.rank` is unknown or greater than `rank`.
code: def broadcast_to_rank(self, rank):
      """Adds leading size-1 dimensions to broadcast `self` to the given rank.
  
      E.g., if `shape1` is `[3, (D2), 4]`, then `shape1.broadcast_to_rank(5)`
      is `[1, 1, 3, (D2), 4]`.
  
      Args:
        rank: The rank for the returned shape.
  
      Returns:
        A RaggedTensorDynamicShape with `rank` dimensions, whose inner dimensions
        have the same size as `self` and whose outer dimensions have size `1`.
  
      Raises:
        ValueError: If `self.rank` is unknown or greater than `rank`.
      """
      if self.rank is None:
          raise ValueError("Unable to broadcast: self.rank is unknown")
      dims_to_add = rank - self.rank
      if dims_to_add < 0:
          raise ValueError(
              "Unable to broadcast: rank=%d must be greater than "
              "self.rank=%d." % (rank, self.rank)
          )
      elif dims_to_add == 0:
          return self
      elif self._partitioned_dim_sizes:
          partitioned_dims = (
              1,
          ) * dims_to_add + self._partitioned_dim_sizes
          return RaggedTensorDynamicShape(
              partitioned_dims,
              self.inner_dim_sizes,
              self.dim_size_dtype,
          )
      else:
          inner_dims = array_ops.concat(
              [
                  array_ops.ones([dims_to_add], self.dim_size_dtype),
                  self.inner_dim_sizes,
              ],
              axis=0,
          )
          return RaggedTensorDynamicShape(
              [], inner_dims, self.dim_size_dtype
          )
  
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 13 for calling the RaggedTensorDynamicShape obj's underlying member method code with example usage: obj.broadcast_to_rank(rank) and returns: self, RaggedTensorDynamicShape, RaggedTensorDynamicShape