import torch


def linf_for(diff):
    """
    Compute usinf for loop.

    :param diff: a mini-batch
    :return: sum of linf dinstances for each data point in the mini-batch diff.
    """
    linf_sum = 0
    for x in diff:
        max = torch.max(torch.abs(x))
        linf_sum += max
    return linf_sum