Avoid Windows warnings in Transformantions (#14304)
* Avoid Windows warnings * Don't change public API * Enhance input shape control
This commit is contained in:
parent
0c6015f669
commit
8ad74c17a4
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,6 +12,7 @@ cmake-build*
|
||||
# developer tools
|
||||
*.idea
|
||||
.vscode
|
||||
.vs/
|
||||
.DS_Store
|
||||
**/tags
|
||||
compile_commands.json
|
||||
|
@ -9,13 +9,6 @@ file(GLOB_RECURSE PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
|
||||
|
||||
set(PUBLIC_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
ie_add_compiler_flags(/wd4018)
|
||||
ie_add_compiler_flags(/wd4305)
|
||||
ie_add_compiler_flags(/wd4267)
|
||||
endif()
|
||||
|
||||
|
||||
# Create named folders for the sources within the .vcproj
|
||||
# Empty name lists them directly under the .vcproj
|
||||
|
||||
@ -63,7 +56,7 @@ set_target_properties(${TARGET_NAME}_obj PROPERTIES INTERPROCEDURAL_OPTIMIZATION
|
||||
|
||||
openvino_developer_export_targets(COMPONENT core_legacy TARGETS ${TARGET_NAME})
|
||||
|
||||
# temporary workaround for fatal error LNK1248: image size (1004722F6) exceeds maximum
|
||||
# temporary workaround for fatal error LNK1248: image size (1004722F6) exceeds maximum
|
||||
# allowable size (FFFFFFFF)
|
||||
# the symbolic debugging information will be stored in a separate .pdb file.
|
||||
if(WIN32)
|
||||
|
@ -228,8 +228,9 @@ ov::pass::GeluFusionWithErfFour::GeluFusionWithErfFour() {
|
||||
return false;
|
||||
}
|
||||
|
||||
constexpr auto sqrt2 = static_cast<float>(M_SQRT2);
|
||||
bool valid_constant_values =
|
||||
ngraph::op::util::has_constant_value<float>(mul1_const_value, 1.0f / M_SQRT2, 0.001f) &&
|
||||
ngraph::op::util::has_constant_value<float>(mul1_const_value, 1.0f / sqrt2, 0.001f) &&
|
||||
ngraph::op::util::has_constant_value<float>(add_const_value, 0.5f) &&
|
||||
ngraph::op::util::has_constant_value<float>(mul2_const_value, 0.5f);
|
||||
|
||||
|
@ -56,7 +56,7 @@ bool ov::pass::MarkPrecisionSensitiveDivides::run_on_model(const std::shared_ptr
|
||||
if (auto sub_graph_node = ov::as_type<ov::op::util::MultiSubGraphOp>(input_node)) {
|
||||
size_t sub_graphs_num = sub_graph_node->get_internal_subgraphs_size();
|
||||
for (size_t sub_graph_ind = 0; sub_graph_ind < sub_graphs_num; ++sub_graph_ind) {
|
||||
auto sub_graph = sub_graph_node->get_function(sub_graph_ind);
|
||||
auto sub_graph = sub_graph_node->get_function(static_cast<int>(sub_graph_ind));
|
||||
run_on_model(sub_graph);
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ bool ov::pass::MarkPrecisionSensitiveSubgraphs::run_on_model(const std::shared_p
|
||||
if (auto sub_graph_node = ov::as_type<ov::op::util::MultiSubGraphOp>(input_node)) {
|
||||
size_t sub_graphs_num = sub_graph_node->get_internal_subgraphs_size();
|
||||
for (size_t sub_graph_ind = 0; sub_graph_ind < sub_graphs_num; ++sub_graph_ind) {
|
||||
auto sub_graph = sub_graph_node->get_function(sub_graph_ind);
|
||||
auto sub_graph = sub_graph_node->get_function(static_cast<int>(sub_graph_ind));
|
||||
run_on_model(sub_graph);
|
||||
}
|
||||
}
|
||||
|
@ -66,11 +66,19 @@ public:
|
||||
|
||||
// Apply callback to materialize RIC inside graph
|
||||
void materialize(Input<Node> input, const ov::NodeVector& nodes) const {
|
||||
if (get_axis() >= input.get_partial_shape().size()) {
|
||||
const auto& input_pshape = input.get_partial_shape();
|
||||
const auto input_rank = input_pshape.rank();
|
||||
if (input_rank.is_dynamic()) {
|
||||
NGRAPH_DEBUG << "Axis calculated to materialize RIC on input: input rank is dynamic";
|
||||
return;
|
||||
}
|
||||
const auto axis = get_axis();
|
||||
// Despite of m_axis is signed integer this transformartion does not handle negative axes values
|
||||
if (axis < 0 || axis >= static_cast<int64_t>(input_pshape.size())) {
|
||||
NGRAPH_DEBUG << "Axis calculated to materialize RIC on input: " << input << " is out of range";
|
||||
return;
|
||||
}
|
||||
const auto& axis_dim = input.get_partial_shape()[get_axis()];
|
||||
const auto& axis_dim = input_pshape[axis];
|
||||
if (axis_dim.is_dynamic()) {
|
||||
NGRAPH_DEBUG << "Axis calculated to materialize RIC on input: " << input << " is dynamic";
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user