tf.raw_ops.RaggedRange
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Returns a RaggedTensor
containing the specified sequences of numbers.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.raw_ops.RaggedRange
tf.raw_ops.RaggedRange(
starts,
limits,
deltas,
Tsplits=tf.dtypes.int64
,
name=None
)
Returns a RaggedTensor
result
composed from rt_dense_values
and
rt_nested_splits
, such that
result[i] = range(starts[i], limits[i], deltas[i])
.
(rt_nested_splits, rt_dense_values) = ragged_range(
starts=[2, 5, 8], limits=[3, 5, 12], deltas=1)
result = tf.ragged.from_row_splits(rt_dense_values, rt_nested_splits)
print(result)
<tf.RaggedTensor [[2], [], [8, 9, 10, 11]] >
The input tensors starts
, limits
, and deltas
may be scalars or vectors.
The vector inputs must all have the same size. Scalar inputs are broadcast
to match the size of the vector inputs.
Args |
starts
|
A Tensor . Must be one of the following types: bfloat16 , float32 , float64 , int32 , int64 .
The starts of each range.
|
limits
|
A Tensor . Must have the same type as starts .
The limits of each range.
|
deltas
|
A Tensor . Must have the same type as starts .
The deltas of each range.
|
Tsplits
|
An optional tf.DType from: tf.int32, tf.int64 . Defaults to tf.int64 .
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (rt_nested_splits, rt_dense_values).
|
rt_nested_splits
|
A Tensor of type Tsplits .
|
rt_dense_values
|
A Tensor . Has the same type as starts .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.RaggedRange\n\n\u003cbr /\u003e\n\nReturns a `RaggedTensor` containing the specified sequences of numbers.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.RaggedRange`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/RaggedRange)\n\n\u003cbr /\u003e\n\n tf.raw_ops.RaggedRange(\n starts,\n limits,\n deltas,\n Tsplits=../../tf/dtypes#int64,\n name=None\n )\n\nReturns a `RaggedTensor` `result` composed from `rt_dense_values` and\n`rt_nested_splits`, such that\n`result[i] = range(starts[i], limits[i], deltas[i])`. \n\n (rt_nested_splits, rt_dense_values) = ragged_range(\n starts=[2, 5, 8], limits=[3, 5, 12], deltas=1)\n result = tf.ragged.from_row_splits(rt_dense_values, rt_nested_splits)\n print(result)\n \u003ctf.RaggedTensor [[2], [], [8, 9, 10, 11]] \u003e\n\nThe input tensors `starts`, `limits`, and `deltas` may be scalars or vectors.\nThe vector inputs must all have the same size. Scalar inputs are broadcast\nto match the size of the vector inputs.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------|\n| `starts` | A `Tensor`. Must be one of the following types: `bfloat16`, `float32`, `float64`, `int32`, `int64`. The starts of each range. |\n| `limits` | A `Tensor`. Must have the same type as `starts`. The limits of each range. |\n| `deltas` | A `Tensor`. Must have the same type as `starts`. The deltas of each range. |\n| `Tsplits` | An optional [`tf.DType`](../../tf/dtypes/DType) from: `tf.int32, tf.int64`. Defaults to [`tf.int64`](../../tf#int64). |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|--------------------|--------------------------------------------|\n| A tuple of `Tensor` objects (rt_nested_splits, rt_dense_values). ||\n| `rt_nested_splits` | A `Tensor` of type `Tsplits`. |\n| `rt_dense_values` | A `Tensor`. Has the same type as `starts`. |\n\n\u003cbr /\u003e"]]