Fix Windows build failure after DDP PR merged (#45335)
Summary:
Fixes #{issue number}
This is resubmit for PR https://github.com/pytorch/pytorch/issues/42897 . Together with fix for Windows build issue introduced by PR https://github.com/pytorch/pytorch/issues/44344 .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45335
Reviewed By: zou3519
Differential Revision: D23931471
Pulled By: mrshenli
fbshipit-source-id: f49b5a114944c1450b32934b3292170be064f494