I just happened to notice that computing the L2 distance between two tensors is consistently 3-6 times slower when using the builtin torch.norm versus manually computing the square root of the sum of squares.
x = torch.randn(1024, 256)
y = torch.randn(1024, 256)

%%timeit
torch.sqrt((x - y).pow(2).sum(1))

333 µs ± 2.06 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
%%timeit
torch.norm(x - y, 2, 1)

2.01 ms ± 102 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
Is this to be expected? Does anyone know why there is such a difference in performance here?