Modify a few APIs to take/return const Tensor& instead of Tensor& (#55797)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55797
In all of these cases, the inside of the function didn't make use
of the fact that the tensor was a mutable reference
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: Imported from OSS
Reviewed By: bdhirsh
Differential Revision: D27712132
Pulled By: ezyang
fbshipit-source-id: 99e0bb1d783f63d2d42ab53d3d406b2064405ef4