Constructs a constant RaggedTensor from a nested Python list.
tf.ragged.constant(
    pylist,
    dtype=None,
    ragged_rank=None,
    inner_shape=None,
    name=None,
    row_splits_dtype=tf.dtypes.int64
) -> Union[tf.RaggedTensor, ops._EagerTensorBase, tf.Operation]
Used in the notebooks
  
    
      | Used in the guide | Used in the tutorials | 
  
  
    
      |  |  | 
  
Example:
tf.ragged.constant([[1, 2], [3], [4, 5, 6]])
<tf.RaggedTensor [[1, 2], [3], [4, 5, 6]]>
All scalar values in pylist must have the same nesting depth K, and the
returned RaggedTensor will have rank K.  If pylist contains no scalar
values, then K is one greater than the maximum depth of empty lists in
pylist.  All scalar values in pylist must be compatible with dtype.
| Args | 
|---|
| pylist | A nested list,tupleornp.ndarray.  Any nested element that
is not alist,tupleornp.ndarraymust be a scalar value
compatible withdtype. | 
| dtype | The type of elements for the returned RaggedTensor.  If not
specified, then a default is chosen based on the scalar values inpylist. | 
| ragged_rank | An integer specifying the ragged rank of the returned RaggedTensor.  Must be nonnegative and less thanK. Defaults tomax(0, K - 1)ifinner_shapeis not specified.  Defaults tomax(0, K - 1 - len(inner_shape))ifinner_shapeis specified. | 
| inner_shape | A tuple of integers specifying the shape for individual inner
values in the returned RaggedTensor.  Defaults to()ifragged_rankis not specified.  Ifragged_rankis specified, then a default is chosen
based on the contents ofpylist. | 
| name | A name prefix for the returned tensor (optional). | 
| row_splits_dtype | data type for the constructed RaggedTensor's row_splits.
One oftf.int32ortf.int64. | 
| Returns | 
|---|
| A potentially ragged tensor with rank Kand the specifiedragged_rank,
containing the values frompylist. | 
| Raises | 
|---|
| ValueError | If the scalar values in pylisthave inconsistent nesting
depth; or if ragged_rank or inner_shape are incompatible withpylist. |