import torch


def compute_linear_kernel(batch):
    """
    Computes the linear kernel between input vectors.
    :param batch: torch.Tensor, input vectors
    :return: torch.Tensor, matrix A such that A_ij = batch[i]^T batch[j] (for flattened batch[i] and batch[j])
    """
    return torch.mm(batch.view(batch.shape[0], -1), batch.view(batch.shape[0], -1).transpose(0, 1))