Skip to content

Commit 7af7169

Browse files
committed
fix: fix the schema not found for node error
Signed-off-by: Bo Wang <[email protected]>
1 parent 95a6732 commit 7af7169

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/partitioning/partitioning.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ 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()) {
3942
return true;
4043
}

0 commit comments

Comments
 (0)