def BaseZeroState(self,
                    theta,
                    encoder_outputs,
                    bs,
                    misc_zero_states,
                    per_step_source_padding=None):
    """Returns initial state of RNNs, and attention."""
    p = self.params
    rnn_states = []
    for i in range(p.rnn_layers):
      rnn_states.append(self.rnn_cell[i].zero_state(theta.rnn_cell[i], bs))

    packed_src = self._InitAttention(theta, encoder_outputs)
    zero_atten_state = self.atten.ZeroAttentionState(
        tf.shape(encoder_outputs.padding)[0], bs)
    (atten_context, atten_probs, atten_states) = (
        self.atten.ComputeContextVectorWithSource(
            theta.atten,
            packed_src,
            py_utils.Zeros([bs, self.rnn_cell[0].params.num_output_nodes],
                           dtype=py_utils.FPropDtype(p)),
            zero_atten_state,
            per_step_source_padding=per_step_source_padding))
    atten_context = self.contextualizer.ZeroAttention(
        theta.contextualizer, bs, misc_zero_states, atten_context, packed_src)

    return rnn_states, atten_context, atten_probs, atten_states, packed_src
Returns initial state of RNNs, and attention.
contrib/lingvo-patched-decoder.py