import torch


def mae_ratio(prediction, target):
    """
    Computes the mean absolute error between prediction and target
    divided by the absolute values of target

    Parameters
    ----------

    prediction: torch.Tensor (N, T)
    target: torch.Tensor (N, T)
    """
    return torch.mean(
        torch.abs(target - prediction) / (torch.abs(target) + 1e-7), dim=0
    )