def squared_error(x, y):
    """
    Squared error, element wise
    :param x: (B,d)
    :param y:  (B,d)
    :return: (B,)
    """
    d = x - y
    z = d * d

    z = z.view(z.shape[0], -1)
    return z