Skip to content

Commit

Permalink
Merge branch 'master' into feature/utils-generate-input-output-model-…
Browse files Browse the repository at this point in the history
…names
  • Loading branch information
praasz authored Feb 14, 2025
2 parents 719357c + e550a08 commit 8915077
Show file tree
Hide file tree
Showing 70 changed files with 983 additions and 553 deletions.
3 changes: 1 addition & 2 deletions src/bindings/python/src/pyopenvino/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ py::object from_ov_any(const ov::Any& any) {
std::string property_name = it;
auto mutability = it.get_mutability();
std::string mutability_str;
switch (mutability)
{
switch (mutability) {
case ov::PropertyMutability::RW:
mutability_str = "RW";
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class TRANSFORMATIONS_API KeepConstPrecision : public ov::pass::MatcherPass {
public:
OPENVINO_MATCHER_PASS_RTTI("KeepConstPrecision");
explicit KeepConstPrecision(const element::TypeVector& precisions,
bool fold_subtract_const = false,
bool fold_multiply_const = true);
bool fold_subtract_const = false,
bool fold_multiply_const = true);
};

} // namespace pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ we cannot perform swapping as this would break another part of the graph.
ZP Const
Input Convert Input
│ │ │ │
▼ ▼ ▼ ▼
Input Convert Input
│ │ │ │
▼ ▼ ▼ ▼
Scale Convert Reshape Reshape Convert Scale
| │ (64,1,1,1) (1,64,1,1) │ │
| │ │ │ │ |
▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼
Reshape Subtract Subtract Reshape
| | | |
▼ ▼ ▼ ▼
Expand All @@ -73,13 +73,13 @@ Though, we can perform swapping if the shapes are same for all branches: e.g.
ZP Const
Input Convert Input
│ │ │ │
▼ ▼ ▼ ▼
Input Convert Input
│ │ │ │
▼ ▼ ▼ ▼
Convert Reshape Reshape Convert
Scale │ (64,1,1,1) (64,1,1,1) │ Scale
| │ │ │ │ |
▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼
Reshape Subtract Subtract Reshape
| | | |
▼ ▼ ▼ ▼
Expand All @@ -104,8 +104,8 @@ Scale Convert Convert Input
Subtract Reshape
| |
▼ ▼
Multiply
Multiply
Step 2: the right part of the graph would be matched transforming the graph above into the final form:
ZP Const
Expand Down Expand Up @@ -150,17 +150,18 @@ bool can_swap(const PatternValueMap& pt_map,
auto first_shape = target_inputs.begin()->get_node()->output(0).get_shape();

// Step 1 (see steps description in the comments above)
if (std::all_of(std::next(target_inputs.begin()), target_inputs.end(),
if (std::all_of(std::next(target_inputs.begin()),
target_inputs.end(),
[&](const ov::Input<ov::Node>& input) {
return input.get_node()->get_output_partial_shape(0).is_static() &&
input.get_node()->get_shape() == first_shape;
})) {
return true;
return true;
} else if (first_node->get_output_partial_shape(0).is_static() &&
second_node->get_output_partial_shape(0).is_static() &&
first_node->get_output_shape(0) == second_node->get_output_shape(0)) {
// Step 2
return true;
// Step 2
return true;
}
}
}
Expand Down
Loading

0 comments on commit 8915077

Please sign in to comment.