def METHOD_NAME(tensor, expected, threshold=0.001):
    if isinstance(tensor, (list, tuple)):
        for t, e in zip(tensor, expected):
            METHOD_NAME(t, e)
    else:
        if (tensor - expected).abs().max() > threshold:
            barf()