Corrected variable name and added test (#26503)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26503
[pytorch] [distributed] Corrected variable name and added test
ghstack-source-id: 90454793
Test Plan: Made sure pg based UT works.
Differential Revision: D17488846
fbshipit-source-id: 6e6cba110a6f61ee1af3d37c5a41c69701de1a8b