add set_grad_enabled to TorchScript and fix data attribute
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/25350
Test Plan: Imported from OSS
Differential Revision: D17100829
fbshipit-source-id: d85d6f3b03218b9c77e144365940eeaa5b4cce9a