Autograd functional API should enable_grad (#47543)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/44640
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47543
Reviewed By: albanD
Differential Revision: D26965136
Pulled By: iramazanli
fbshipit-source-id: 1dd46b9402bb670c0e165db684712e26c1a2036f