tf.ragged.row_splits_to_segment_ids
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Generates the segmentation corresponding to a RaggedTensor row_splits
.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.ragged.row_splits_to_segment_ids
tf.ragged.row_splits_to_segment_ids(
splits, name=None, out_type=None
)
Returns an integer vector segment_ids
, where segment_ids[i] == j
if
splits[j] <= i < splits[j+1]
. Example:
print(tf.ragged.row_splits_to_segment_ids([0, 3, 3, 5, 6, 9]))
tf.Tensor([0 0 0 2 2 3 4 4 4], shape=(9,), dtype=int64)
Args |
splits
|
A sorted 1-D integer Tensor. splits[0] must be zero.
|
name
|
A name prefix for the returned tensor (optional).
|
out_type
|
The dtype for the return value. Defaults to splits.dtype ,
or tf.int64 if splits does not have a dtype.
|
Returns |
A sorted 1-D integer Tensor, with shape=[splits[-1]]
|
Raises |
ValueError
|
If splits is invalid.
|
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-01-23 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-01-23 UTC."],[],[]]