Maybe try nn.PairwiseDistance witht p=1?
http://pytorch.org/docs/nn.html#torch.nn.PairwiseDistance 241
EDIT: Your loss function could be:
loss = torch.abs(outA - outB)
#take the average over the batch
loss = loss.sum() / batch_size