Skip to content

Commit 06de861

Browse files
authored
Merge pull request #1236 from pytorch/fix_schema_error
fix: fix the "schema not found for node" error
2 parents 5fa38f4 + 3113f36 commit 06de861

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/partitioning/partitioning.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ bool containNonTensorOutputs(torch::jit::Node* n) {
3131
}
3232

3333
bool isModifyingNodes(torch::jit::Node* node, torch::jit::Value* val) {
34-
const auto& schema = node->schema();
34+
const torch::jit::FunctionSchema* schema = node->maybeSchema();
35+
if (!schema) {
36+
return false;
37+
}
3538
for (size_t i = 0; i < node->inputs().size(); ++i) {
3639
if (node->inputs()[i] == val) {
37-
const at::AliasInfo* formal = schema.arguments()[i].alias_info();
40+
const at::AliasInfo* formal = schema->arguments()[i].alias_info();
3841
if (formal && formal->isWrite()) {
42+
LOG_GRAPH(
43+
util::node_info(node) << " is a modifying node for value " << val->debugName()
44+
<< ", add it to the dependency graph.");
3945
return true;
4046
}
4147
}

0 commit comments

Comments
 (0)