change self.generator to generator (#44461)
Summary:
bug fix
Pull Request resolved: https://github.com/pytorch/pytorch/pull/44461
Reviewed By: mruberry
Differential Revision: D23725053
Pulled By: ngimel
fbshipit-source-id: 89706313013d9eae96aaaf144924867457efd2c0