Skip to content

Commit a62aea6

Browse files
committed
Refactor clamp name construction to use stringstream
1 parent 10866dc commit a62aea6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/core/src/preprocess/preprocess_steps_impl.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ void PreStepsList::add_scale_impl(const std::vector<float>& values) {
100100
}
101101

102102
void PreStepsList::add_clamp(double min_value, double max_value) {
103-
std::string name = "clamp(min " + std::to_string(min_value) + ", max " + std::to_string(max_value) + ")";
103+
std::stringstream name_builder;
104+
name_builder << "clamp(min " << min_value << ", max " << max_value << ")";
104105

105106
m_actions.emplace_back(
106107
[min_value, max_value](const std::vector<Output<Node>>& nodes,
@@ -114,7 +115,7 @@ void PreStepsList::add_clamp(double min_value, double max_value) {
114115
auto clamp_op = std::make_shared<ov::op::v0::Clamp>(node, min_value, max_value);
115116
return std::make_tuple(std::vector<Output<Node>>{clamp_op}, true);
116117
},
117-
name);
118+
name_builder.str());
118119
}
119120

120121
void PreStepsList::add_mean_impl(const std::vector<float>& values) {
@@ -707,14 +708,15 @@ std::tuple<std::vector<Output<Node>>, bool> PreStepsList::cut_last_channel(const
707708

708709
//------------- Post processing ------
709710
void PostStepsList::add_clamp(double min_value, double max_value) {
710-
std::string name = "clamp(min " + std::to_string(min_value) + ", max " + std::to_string(max_value) + ")";
711+
std::stringstream name_builder;
712+
name_builder << "clamp(min " << min_value << ", max " << max_value << ")";
711713

712714
m_actions.emplace_back(
713715
[min_value, max_value](const Output<Node>& node, PostprocessingContext& ctxt) {
714716
auto clamp_op = std::make_shared<ov::op::v0::Clamp>(node, min_value, max_value);
715717
return std::make_tuple(Output<Node>{clamp_op}, true);
716718
},
717-
name);
719+
name_builder.str());
718720
}
719721

720722
void PostStepsList::add_convert_impl(const element::Type& type) {

0 commit comments

Comments
 (0)