tf.contrib.seq2seq.gather_tree
Stay organized with collections
Save and categorize content based on your preferences.
Calculates the full beams from the per-step ids and parent beam ids.
tf.contrib.seq2seq.gather_tree(
step_ids, parent_ids, max_sequence_lengths, end_token, name=None
)
On CPU, if an out of bound parent id is found, an error is returned.
On GPU, if an out of bound parent id is found, a -1 is stored in the
corresponding output value and the execution for that beam returns early.
For a given beam, past the time step containing the first decoded end_token
all values are filled in with end_token
.
Args |
step_ids
|
A Tensor . Must be one of the following types: int32 .
[max_time, batch_size, beam_width] .
|
parent_ids
|
A Tensor . Must have the same type as step_ids .
[max_time, batch_size, beam_width] .
|
max_sequence_lengths
|
A Tensor of type int32 . [batch_size] .
|
end_token
|
A Tensor . Must have the same type as step_ids . [] .
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor . Has the same type as step_ids .
[max_time, batch_size, beam_width] .
|
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 2020-10-01 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"
}]
{"lastModified": "Last updated 2020-10-01 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 2020-10-01 UTC."],[],[]]