The main reason I can think of is that when you use autograd, we only compute gradients for the things that require gradients. In particular, if the input does not require gradients, then autograd won’t compute grad_input which might explain some perf difference.
Also the function runs purely in cpp which might also explain a few % of difference, especially if you test with small input Tensors.