Skip to content

Commit c9a0bbb

Browse files
committed
apply comments
1 parent 43b04cf commit c9a0bbb

File tree

2 files changed

+178
-178
lines changed

2 files changed

+178
-178
lines changed

src/common/transformations/src/transformations/common_optimizations/rms_fusion.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ RMSFusion::RMSFusion(bool force_tail_convert, bool enable_div_x) {
9696
// Pattern 2: RMS without gamma, but multiplied with dynamic input
9797
// RMS(x) * scale where scale is non-constant (e.g., gate, activation, residual)
9898
// This allows partial fusion: only fuse up to mul_or_div
99-
auto scale = pattern::any_input([](const Output<Node>& value) -> bool {
100-
return !ov::is_type<v0::Constant>(value.get_node_shared_ptr());
101-
});
99+
auto scale = pattern::any_input(pattern::class_other_than<v0::Constant>());
102100
auto mul_with_scale = pattern::wrap_type<v1::Multiply>({mul_or_div, scale});
103101

104102
auto rms_mul = std::make_shared<pattern::op::Or>(OutputVector{mul_with_gamma, mul_with_scale});
@@ -125,12 +123,12 @@ RMSFusion::RMSFusion(bool force_tail_convert, bool enable_div_x) {
125123
}
126124

127125
auto mul_or_div_node = pattern_map.at(mul_or_div).get_node_shared_ptr();
128-
bool elementwise_affine = (pattern_map.find(mul_with_gamma) != pattern_map.end());
126+
bool elementwise_affine = pattern_map.count(mul_with_gamma);
129127

130128
std::shared_ptr<ov::Node> gamma_node;
131129
if (elementwise_affine) {
132130
gamma_node = pattern_map.at(gamma).get_node_shared_ptr();
133-
if (pattern_map.find(gamma_convert) != pattern_map.end()) {
131+
if (pattern_map.count(gamma_convert)) {
134132
gamma_node = pattern_map.at(gamma_convert).get_node_shared_ptr();
135133
}
136134
}

0 commit comments

Comments
 (0)