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

@ -426,4 +426,4 @@ bool op::v8::Slice::evaluate_label(TensorLabelVector& output_labels) const {
if (!slice_input_check(this)) if (!slice_input_check(this))
return false; return false;
return default_label_evaluator(this, output_labels); return default_label_evaluator(this, output_labels);
} }

View File

@ -1203,8 +1203,13 @@ void propagate_rt_info(Node* node, const Output<Node>& final_port) {
for (auto& in : output.get_target_inputs()) { for (auto& in : output.get_target_inputs()) {
if (stop_nodes.count(in.get_node())) if (stop_nodes.count(in.get_node()))
continue; continue;
auto consumer = in.get_node()->shared_from_this(); try {
copy_runtime_info({curr_node, consumer}, consumer); 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.
}
} }
} }
} }