def euclid_dist(x, y):
    """
    Computes the euclidean distance between two pointclouds, returning a
    matrix whose coordinates are the distance between two points.

    Parameters
    ----------

    x: torch.Tensor of size [size_X, dim]
    coordinates of the first group of vectors of R^d.

    y: torch.Tensor of size [size_Y, dim]
    coordinates of the second group of vectors of R^d.

    Returns
    -------
    torch.Tensor of size [size_X, size_Y]
    Matrix of all pairwise distances.
    """
    return (x[:, None, :] - y[None, :, :]).norm(p=2, dim=2)