Use key in dict for existence checks (#167285)
Summary:
This PR uses `key in dict` expressions for existence checks of dict elements in Python code. This operation is more efficient than `key in dict.keys()`.
X-link: https://github.com/pytorch/pytorch/pull/167285
Approved by: https://github.com/mlazos
Reviewed By: donigian
Differential Revision: D86529114
fbshipit-source-id: 59918412b1142cb1267be4675b2f78d81ab74634
Author
generatedunixname499836121