import torch


def get_gram_matrix(tensor):
    """
    Returns a Gram matrix of dimension (distinct_filer_count, distinct_filter_count) where G[i,j] is the
    inner product between the vectorised feature map i and j in layer l
    """

    G = torch.mm(tensor, tensor.t())
    return G