rasa/core/policies/embedding_policy.py
def _alignments_history_from(
        final_state: 'TimeAttentionWrapperState'
    ) -> tf.Tensor:
        """Extract alignments history form final rnn cell state."""

        alignments_from_state = final_state.alignment_history
        if not isinstance(alignments_from_state, tuple):
            alignments_from_state = [alignments_from_state]

        alignment_history = []
        for alignments in alignments_from_state:
            # reshape to (batch, time, memory_time)
            alignment_history.append(
                tf.transpose(alignments.stack(), [1, 0, 2]))

        return tf.concat(alignment_history, -1)
Extract alignments history form final rnn cell state.
Extract alignments history form final rnn cell state.
Extract alignments history form final rnn cell state .
def _alignments_history_from(
        final_state: 'TimeAttentionWrapperState'
    ) -> tf.Tensor:
        alignments_from_state = final_state.alignment_history
        if not isinstance(alignments_from_state, tuple):
            alignments_from_state = [alignments_from_state]
        alignment_history = []
        for alignments in alignments_from_state:
            alignment_history.append(
                tf.transpose(alignments.stack(), [1, 0, 2]))
        return tf.concat(alignment_history, -1)
def _alignments_history_from ( final_state : 'TimeAttentionWrapperState' ) -> tf . Tensor : alignments_from_state = final_state . alignment_history if not isinstance ( alignments_from_state , tuple ) : alignments_from_state = [ alignments_from_state ] alignment_history = [ ] for alignments in alignments_from_state : alignment_history . append ( tf . transpose ( alignments . stack ( ) , [ 1 , 0 , 2 ] ) ) return tf . concat ( alignment_history , - 1 )
Extract alignments history form final rnn cell state.
Extract alignments history form final rnn cell state .
"""Extract alignments history form final rnn cell state.""" # reshape to (batch, time, memory_time)
final_state
'TimeAttentionWrapperState'