Called per step of decoding (but only once for dynamic decoding). Args: time: Scalar `int32` tensor. Current step number. inputs: RNNCell input (possibly nested tuple of) tensor[s] for this time step. state: RNNCell state (possibly nested tuple of) tensor[s] from previ
(self, time, inputs, state, name=None)
| 93 | |
| 94 | @abc.abstractmethod |
| 95 | def step(self, time, inputs, state, name=None): |
| 96 | """Called per step of decoding (but only once for dynamic decoding). |
| 97 | |
| 98 | Args: |
| 99 | time: Scalar `int32` tensor. Current step number. |
| 100 | inputs: RNNCell input (possibly nested tuple of) tensor[s] for this time |
| 101 | step. |
| 102 | state: RNNCell state (possibly nested tuple of) tensor[s] from previous |
| 103 | time step. |
| 104 | name: Name scope for any created operations. |
| 105 | |
| 106 | Returns: |
| 107 | `(outputs, next_state, next_inputs, finished)`: `outputs` is an object |
| 108 | containing the decoder output, `next_state` is a (structure of) state |
| 109 | tensors and TensorArrays, `next_inputs` is the tensor that should be used |
| 110 | as input for the next step, `finished` is a boolean tensor telling whether |
| 111 | the sequence is complete, for each sequence in the batch. |
| 112 | """ |
| 113 | raise NotImplementedError |
| 114 | |
| 115 | def finalize(self, outputs, final_state, sequence_lengths): |
| 116 | """Called after decoding iterations complete. |