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: Constructs a ragged shape from a list of dimension sizes.
  
  This list contains a single tensor for each dimension, where the tensor
  is a scalar if the dimension is uniform, or a vector if the dimension is
  ragged.
  
  Args:
    dim_sizes: List of int32 or int64 scalars or vectors.
  
  Returns:
    A RaggedTensorDynamicShape.
code: def from_dim_sizes(dim_sizes):
      """Constructs a ragged shape from a list of dimension sizes.
  
      This list contains a single tensor for each dimension, where the tensor
      is a scalar if the dimension is uniform, or a vector if the dimension is
      ragged.
  
      Args:
        dim_sizes: List of int32 or int64 scalars or vectors.
  
      Returns:
        A RaggedTensorDynamicShape.
      """
      with ops.name_scope(
          None,
          "RaggedTensorDynamicShapeFromDimensionSizes",
          [dim_sizes],
      ):
          dim_sizes = tuple(
              ops.convert_to_tensor(
                  size, preferred_dtype=dtypes.int64, name="dim_sizes"
              )
              for size in dim_sizes
          )
          # Split the dimensions into partitioned & inner dimensions.
          inner_split = 0
          for dim, dim_size in enumerate(dim_sizes):
              if dim_size.shape.ndims == 1:
                  inner_split = dim + 1
              elif dim_size.shape.ndims != 0:
                  raise ValueError(
                      "Each dim_size must be a scalar or a vector"
                  )
          return RaggedTensorDynamicShape(
              dim_sizes[:inner_split], dim_sizes[inner_split:]
          )
  
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 3 for calling the RaggedTensorDynamicShape obj's underlying member method code with example usage: obj.from_dim_sizes(dim_sizes) and returns: RaggedTensorDynamicShape