import torch


def get_position_encoding_expectation(pos_prob, embed_matrix):
    """

    Args:
        pos_prob: (FloatTensor) [batch_size,seq_len,max_len]
        embed_matrix: (FloatTensor) [max_len.hidden_size] w/o requires_grad

    Returns: expectation position encoding

    """
    return torch.matmul(pos_prob, embed_matrix)