Fix `Module.share_memory` error (#80843) (#80843) (#81867)
Summary:
Fixes #80733
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80843
Approved by: https://github.com/malfet
Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/4c279994fd56e3d0c34dcd39adedb73abccb0b65
Reviewed By: mehtanirav
Differential Revision: D37619124
Pulled By: mehtanirav
fbshipit-source-id: 2b0d71d5a420d4aab286eea0b3cccdc96d15afeb
Co-authored-by: Kurt Mohler <kmohler@quansight.com>