torchfix
torchfix copied to clipboard
New rule: use `dtype` instead of converting after creation
For many ops dtype
parameter can be provided, and it should be preferred (from readability and performance point of views) to use it instead of converting the op results to a different type.
For example, torch.arange(1, N).float()
should be changed to torch.arange(1, N, dtype=torch.float32)
cc @malfet