Yeah, somehow the setup in the timeit function does not seem to work properly for PyTorch. Maybe it’s because of the C-extensions and that it doesn’t import it completely before starting the timing and executing “torch.zeros” or sth like this.
Using the timeit magic command via ipython gives more reasonable results:
In [1]: import torch

In [2]: %timeit torch.zeros(10,10,20)
2.09 µs ± 31.5 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)