import torch


def euclidean_distances(x, y):
    """ Computes pairwise distances
        
        @param x: a [n x d] torch.FloatTensor of datapoints
        @param y: a [m x d] torch.FloatTensor of datapoints
        
        @return: a [n x m] torch.FloatTensor of pairwise distances 
    """
    return torch.norm(x.unsqueeze(1) - y.unsqueeze(0), dim=2)