Fix unused Python variables outside torch/ and test/ (#136359)
Summary:
X-link: https://github.com/pytorch/pytorch/pull/136359
Approved by: https://github.com/albanD
Reviewed By: clee2000
Differential Revision: D67115192
fbshipit-source-id: 65e4ccafac9046d78e1de4234d5aa00894274c81