Fix for issue 14829 (#14908)
Summary:
* Modify the testcase as outlined in the issue
* Issue url: https://github.com/pytorch/pytorch/issues/14829
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14908
Differential Revision: D13490360
Pulled By: ezyang
fbshipit-source-id: ff11a72e19b49223652182e82c2b4e65fe444ca7