fix py-compat fbcode lint warnings
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23530
Test Plan: Imported from OSS
Reviewed By: jamesr66a
Differential Revision: D16552212
Pulled By: suo
fbshipit-source-id: 7c7de5a096ad9a125976e4710d3660294d3991c5