import torch


def my_l1(x, x_recon):
    """Calculate l1 loss

    Parameters
    ----------
    x : torch.cuda.FloatTensor or torch.FloatTensor
        Input data
    x_recon : torch.cuda.FloatTensor or torch.FloatTensor
        Reconstructed input

    Returns
    -------
    torch.cuda.FloatTensor or torch.FloatTensor
    """
    return torch.mean(torch.abs(x-x_recon))