Handle error from propagate_rt_info (#11773)

This commit is contained in:
Katarzyna Mitrus 2022-06-13 11:11:30 +02:00 committed by GitHub
parent 922e32e2f1
commit 421520bda0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -1203,8 +1203,13 @@ void propagate_rt_info(Node* node, const Output<Node>& final_port) {
for (auto& in : output.get_target_inputs()) {
if (stop_nodes.count(in.get_node()))
continue;
try {
auto consumer = in.get_node()->shared_from_this();
copy_runtime_info({curr_node, consumer}, consumer);
} catch (const std::bad_weak_ptr&) {
// Exception can be thrown, if `shared_from_this()` was called during node creation.
// Continue propagation for other nodes.
}
}
}
}