tfr.utils.organize_valid_indices
Stay organized with collections
Save and categorize content based on your preferences.
Organizes indices in such a way that valid items appear first.
tfr.utils.organize_valid_indices(
is_valid, shuffle=True, seed=None
)
Args |
is_valid
|
A boolean Tensor for entry validity with shape [batch_size,
list_size].
|
shuffle
|
A boolean indicating whether valid items should be shuffled.
|
seed
|
An int for random seed at the op level. It works together with the
seed at global graph level together to determine the random number
generation. See tf.set_random_seed .
|
Returns |
A tensor of indices with shape [batch_size, list_size, 2]. The returned
tensor can be used with tf.gather_nd and tf.scatter_nd to compose a new
[batch_size, list_size] tensor. The values in the last dimension are the
indices for an element in the input tensor.
|
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.
Last updated 2023-08-18 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 2023-08-18 UTC."],[],[]]