def _GetInitialSeqStateTensorArrays(self, max_seq_length,
                                      decoder_step_state_zero_fusion_flat,
                                      decoder_step_state_zero_misc_flat):
    """Get intitial tensor arrays for ComputePredictionsDynamic."""
    p = self.params
    # TensorArrays for sequence outputs.
    return AsrDecoder.SequenceOutTensorArrays(
        rnn_outs=[
            _NewTensorArray(
                name='rnn%d_outs' % i,
                max_seq_length=max_seq_length,
                dtype=py_utils.FPropDtype(p)) for i in range(p.rnn_layers)
        ],
        step_outs=_NewTensorArray(
            name='step_outs',
            max_seq_length=max_seq_length,
            dtype=py_utils.FPropDtype(p)),
        atten_probs=_NewTensorArray(
            name='atten_probs',
            max_seq_length=max_seq_length,
            dtype=py_utils.FPropDtype(p)),
        logits=_NewTensorArray(
            name='logits',
            max_seq_length=max_seq_length,
            dtype=py_utils.FPropDtype(p)),
        fusion=[
            _NewTensorArray(
                name='fusion_states%d' % i,
                max_seq_length=max_seq_length,
                dtype=decoder_step_state_zero_fusion_flat[i].dtype)
            for i in range(len(decoder_step_state_zero_fusion_flat))
        ],
        misc=[
            _NewTensorArray(
                name='misc_states%d' % i,
                max_seq_length=max_seq_length,
                dtype=decoder_step_state_zero_misc_flat[i].dtype)
            for i in range(len(decoder_step_state_zero_misc_flat))
        ])
Get intitial tensor arrays for ComputePredictionsDynamic.
contrib/lingvo-patched-decoder.py