mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[jit] kill script namespace (#34515)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34515 Once upon a time we thought this was necessary. In reality it is not, so removing it. For backcompat, our public interface (defined in `api/`) still has typedefs to the old `script::` names. There was only one collision: `Pass` as a `Stmt` and `Pass` as a graph transform. I renamed one of them. Test Plan: Imported from OSS Differential Revision: D20353503 Pulled By: suo fbshipit-source-id: 48bb911ce75120a8c9e0c6fb65262ef775dfba93
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cf8b728255
commit
c235be42dd
@ -27,8 +27,8 @@ namespace {
|
||||
|
||||
// PythonTypeResolver that inherits from Script::Resolver to
|
||||
// support resolving types together with ScriptTypeParser.
|
||||
struct PythonTypeResolver : public jit::script::Resolver {
|
||||
std::shared_ptr<jit::script::SugaredValue> resolveValue(
|
||||
struct PythonTypeResolver : public jit::Resolver {
|
||||
std::shared_ptr<jit::SugaredValue> resolveValue(
|
||||
const std::string& /* unused */,
|
||||
torch::jit::Function& /* unused */,
|
||||
const jit::SourceRange& /* unused */) override {
|
||||
@ -67,7 +67,7 @@ PythonRpcHandler::PythonRpcHandler() {
|
||||
pyHandleException_ = getFunction(module, "_handle_exception");
|
||||
pyGetQualifiedName_ = py::module::import("torch.jit").attr("_qualified_name");
|
||||
jitCompilationUnit_ = torch::jit::get_python_cu();
|
||||
typeParser_ = std::make_shared<jit::script::ScriptTypeParser>(
|
||||
typeParser_ = std::make_shared<jit::ScriptTypeParser>(
|
||||
std::make_shared<PythonTypeResolver>());
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ PythonRpcHandler& PythonRpcHandler::getInstance() {
|
||||
return *handler;
|
||||
}
|
||||
|
||||
std::shared_ptr<torch::jit::script::CompilationUnit> PythonRpcHandler::
|
||||
std::shared_ptr<torch::jit::CompilationUnit> PythonRpcHandler::
|
||||
jitCompilationUnit() {
|
||||
return jitCompilationUnit_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user