tfa.seq2seq.gather_tree_from_array
Stay organized with collections
Save and categorize content based on your preferences.
Calculates the full beams for a TensorArray
.
tfa.seq2seq.gather_tree_from_array(
t: tfa.types.TensorLike
,
parent_ids: tfa.types.TensorLike
,
sequence_length: tfa.types.TensorLike
) -> tf.Tensor
Args |
t
|
A stacked TensorArray of size max_time that contains Tensor s of
shape [batch_size, beam_width, s] or [batch_size * beam_width, s]
where s is the depth shape.
|
parent_ids
|
The parent ids of shape [max_time, batch_size, beam_width] .
|
sequence_length
|
The sequence length of shape [batch_size, beam_width] .
|
Returns |
A Tensor which is a stacked TensorArray of the same size and type as
t and where beams are sorted in each Tensor according to
parent_ids .
|
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 2022-06-03 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]