Drop unused variables and add some const (#71106)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/71106
Test Plan: Sandcastle
Reviewed By: ngimel
Differential Revision: D33490855
fbshipit-source-id: 9fc4a4e4a7ad5e6c31f394ec6d8221b964fdf043