Why torch.jit is so slow?

Hi @Daulbaev! The reason torch.jit is slow in your example, is because it’s not designed for this particular use-case :slight_smile: The kinds of speed ups you will see with torch.jit are situations, e.g., when you have a number of pointwise operations, and torch.jit will be able to fuse them together and eliminate overhead and memory traffic. torch.jit, at this point in time, is not designed to take pointwise loops as you’ve written here, and compile them into machine code directly.