Use irange in a few places in torch/csrc (#55100)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55100
Test Plan: Sandcastle
Reviewed By: ngimel
Differential Revision: D27447708
fbshipit-source-id: 4f21133bd76f29d73a51befcae649ab55637b36e