mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +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
@ -17,7 +17,7 @@ namespace jit {
|
||||
*/
|
||||
static void checkRoundtrip(const std::string& s) {
|
||||
auto graph = std::make_shared<Graph>();
|
||||
script::parseIR(s, &*graph);
|
||||
parseIR(s, &*graph);
|
||||
std::ostringstream ss;
|
||||
ss << *graph;
|
||||
std::string parsed = ss.str();
|
||||
@ -42,7 +42,7 @@ void testIRParser() {
|
||||
{
|
||||
auto graph = std::make_shared<Graph>();
|
||||
std::unordered_map<std::string, Value*> vmap;
|
||||
script::parseIR(
|
||||
parseIR(
|
||||
R"IR(
|
||||
graph(%0 : Tensor, %1 : Tensor):
|
||||
%2 : Tensor = foo::add(%0, %1)
|
||||
@ -117,7 +117,7 @@ graph(%0 : Tensor,
|
||||
}
|
||||
{
|
||||
auto graph = std::make_shared<Graph>();
|
||||
script::parseIR(
|
||||
parseIR(
|
||||
R"IR(
|
||||
graph(%a):
|
||||
return (%a))IR",
|
||||
@ -127,7 +127,7 @@ graph(%a):
|
||||
{
|
||||
// Check that parser correctly handles values reusing the same name.
|
||||
auto graph = std::make_shared<Graph>();
|
||||
script::parseIR(
|
||||
parseIR(
|
||||
R"IR(
|
||||
graph(%x):
|
||||
%x = a::a(%x)
|
||||
@ -239,7 +239,7 @@ graph(%0 : Tensor,
|
||||
# CHECK: return
|
||||
return (%a))IR";
|
||||
|
||||
script::parseIR(text, &*graph);
|
||||
parseIR(text, &*graph);
|
||||
AT_ASSERT(graph->inputs()[0]->type()->isSubtypeOf(TensorType::get()));
|
||||
torch::jit::testing::FileCheck().run(text, *graph);
|
||||
}
|
||||
|
Reference in New Issue
Block a user