[jit] move script-related implementation out of torch/jit/__init__.py (#40902)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40902

See the bottom of this stack for context.

Test Plan: Imported from OSS

Reviewed By: eellison

Differential Revision: D22360210

Pulled By: suo

fbshipit-source-id: 4275127173a36982ce9ad357aa344435b98e1faf
This commit is contained in:
Michael Suo
2020-07-08 11:35:52 -07:00
committed by Facebook GitHub Bot
parent 6c9b869930
commit c93e96fbd9
16 changed files with 990 additions and 895 deletions

View File

@ -61,7 +61,7 @@ TypePtr tryInferTypeWithTypeHint(
"The RRef being created contains a ScriptModule, "
"must provide its ModuleInterface type hint. ");
c10::QualifiedName type_qualified_name = c10::QualifiedName(
py::cast<std::string>(py::module::import("torch.jit")
py::cast<std::string>(py::module::import("torch._jit_internal")
.attr("_qualified_name")(type_hint)));
TypePtr type_hint_ptr =
jit::get_python_cu()->get_interface(type_qualified_name);