Skip to content

Commit

Permalink
[PT FE] Fix issue with adding Result to mutated tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
mvafin committed Oct 25, 2023
1 parent 04c766e commit f652840
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/frontends/pytorch/src/translate_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ std::shared_ptr<Model> TranslateSession::convert_pytorch_model(
auto mutated_tensor = tensor_map->at(tensor_id);
// empty external_tensor_map means this is main body of the model and we don't want to create
// additional outputs in that case.
if (mutated_tensor.get_target_inputs().empty() && !external_tensor_map.empty())
if (!external_tensor_map.empty()) {
OPENVINO_DEBUG << "Creating Result for mutated tensor " << tensor_id;
results.push_back(std::make_shared<v0::Result>(tensor_map->at(tensor_id)));
}
} else {
OPENVINO_DEBUG << "Mutated tensor with id " << tensor_id << " doesn't exist in inputs, skipping.";
}
Expand Down

0 comments on commit f652840

Please sign in to comment.