@@ -46,16 +46,15 @@ class BeamSearchDecoderState(
4646):
4747 """State of a `BeamSearchDecoder`.
4848
49- Contains:
50-
51- - `cell_state`: The cell state returned at the previous time step.
52- - `log_probs`: The accumulated log probabilities of each beam.
49+ Attributes:
50+ cell_state: The cell state returned at the previous time step.
51+ log_probs: The accumulated log probabilities of each beam.
5352 A `float32` `Tensor` of shape `[batch_size, beam_width]`.
54- - ` finished` : The finished status of each beam.
53+ finished: The finished status of each beam.
5554 A `bool` `Tensor` of shape `[batch_size, beam_width]`.
56- - ` lengths` : The accumulated length of each beam.
55+ lengths: The accumulated length of each beam.
5756 An `int64` `Tensor` of shape `[batch_size, beam_width]`.
58- - ` accumulated_attention_prob` : Accumulation of the attention
57+ accumulated_attention_prob: Accumulation of the attention
5958 probabilities (used to compute the coverage penalty)
6059 """
6160
@@ -69,19 +68,18 @@ class BeamSearchDecoderOutput(
6968):
7069 """Outputs of a `BeamSearchDecoder` step.
7170
72- Contains:
73-
74- - `scores`: The scores this step, which are the log
71+ Attributes:
72+ scores: The scores this step, which are the log
7573 probabilities over the output vocabulary, possibly penalized by length
7674 and attention coverage. When `BeamSearchDecoder` is created with
7775 `output_all_scores=False` (default), this will be a `float32` `Tensor`
7876 of shape `[batch_size, beam_width]` containing the top scores
7977 corresponding to the predicted IDs. When `output_all_scores=True`,
8078 this contains the scores for all token IDs and has shape
8179 `[batch_size, beam_width, vocab_size]`.
82- - ` predicted_ids` : The token IDs predicted for this step.
80+ predicted_ids: The token IDs predicted for this step.
8381 A `int32` `Tensor` of shape `[batch_size, beam_width]`.
84- - ` parent_ids` : The indices of the parent beam of each beam.
82+ parent_ids: The indices of the parent beam of each beam.
8583 A `int32` `Tensor` of shape `[batch_size, beam_width]`.
8684 """
8785
@@ -93,10 +91,9 @@ class FinalBeamSearchDecoderOutput(
9391 "FinalBeamDecoderOutput" , ["predicted_ids" , "beam_search_decoder_output" ]
9492 )
9593):
96- """Final outputs returned by the beam search after all decoding is
97- finished.
94+ """Final outputs returned by the beam search after all decoding is finished.
9895
99- Args :
96+ Attributes :
10097 predicted_ids: The final prediction. A tensor of shape
10198 `[batch_size, T, beam_width]` (or `[T, batch_size, beam_width]` if
10299 `output_time_major` is True). Beams are ordered from best to worst.
0 commit comments