support torch.as_tensor in script
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23247
Test Plan: Imported from OSS
Differential Revision: D16466590
Pulled By: wanchaol
fbshipit-source-id: cf52721eacd177d9040564790382db13a9fcc2fe