def _predict_log_probabilities_one_step(nn_model, x_batch, y_batch):
        """
        Predict answers for every sequence token by token until EOS_TOKEN occurred in the sequence using sampling with temperature.
        All the rest of the sequence is filled with PAD_TOKENs.
        """
        thought_vectors_batch = nn_model.get_thought_vectors(x_batch)
        hidden_states_batch = np.zeros(
            (x_batch.shape[0], nn_model.decoder_depth, HIDDEN_LAYER_DIMENSION), dtype=K.floatx())

        total_log_probs = np.zeros((y_batch.shape[0], y_batch.shape[1] - 1, nn_model.vocab_size))
        for token_idx in range(1, y_batch.shape[1]):
            hidden_states_batch, next_token_log_probs_batch = \
                get_next_token_log_prob_one_step(nn_model, thought_vectors_batch, hidden_states_batch,
                                                 y_batch[:, token_idx - 1], condition_ids=None)
            # total_log_probs has shape (batch_size x num_tokens x vocab_size)
            total_log_probs[:, token_idx - 1, :] = next_token_log_probs_batch

        return total_log_probs

        Predict answers for every sequence token by token until EOS_TOKEN occurred in the sequence using sampling with temperature.
        All the rest of the sequence is filled with PAD_TOKENs.
        
cakechat/dialog_model/inference/tests/predict.py