import torch


def batched_norm(target, output):
    """ Mean of norm error between target and output matrices """
    target = target.reshape(output.shape)
    diff = target - output
    loss = torch.mean(torch.norm(diff, dim=-1))
    return loss