[ONNX Importer] Switch to opset6 (#4112)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#include "ngraph/opsets/opset5.hpp"
|
||||
#include "ngraph/opsets/opset6.hpp"
|
||||
|
||||
namespace ngraph
|
||||
{
|
||||
namespace onnx_import
|
||||
{
|
||||
namespace default_opset = ngraph::opset5;
|
||||
namespace default_opset = ngraph::opset6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "default_opset.hpp"
|
||||
#include "ngraph/output_vector.hpp"
|
||||
|
||||
namespace ngraph
|
||||
@@ -33,7 +34,7 @@ namespace ngraph
|
||||
auto indices = ng_inputs.at(1);
|
||||
auto axis = node.get_attribute_value<int64_t>("axis", 0);
|
||||
|
||||
return {std::make_shared<ngraph::op::v6::GatherElements>(data, indices, axis)};
|
||||
return {std::make_shared<default_opset::GatherElements>(data, indices, axis)};
|
||||
}
|
||||
} // namespace set_1
|
||||
} // namespace op
|
||||
|
||||
@@ -93,7 +93,8 @@ namespace ngraph
|
||||
const auto reduction_axes =
|
||||
common::get_monotonic_range_along_node_rank(data, 2);
|
||||
|
||||
auto mvn = std::make_shared<default_opset::MVN>(data, false, true, epsilon);
|
||||
auto mvn = std::make_shared<default_opset::MVN>(
|
||||
data, reduction_axes, true, epsilon, ngraph::op::MVNEpsMode::INSIDE_SQRT);
|
||||
|
||||
std::shared_ptr<ngraph::Node> data_shape_node;
|
||||
if (data_pshape.is_static())
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace ngraph
|
||||
body_inputs[0]); // current iteration body input
|
||||
const auto body = std::make_shared<ngraph::Function>(body_outputs, body_params);
|
||||
auto loop = std::make_shared<default_opset::Loop>(trip_count, termination_cond);
|
||||
ngraph::opset5::Loop::SpecialBodyPorts spec_ports{0, 0};
|
||||
default_opset::Loop::SpecialBodyPorts spec_ports{0, 0};
|
||||
loop->set_special_body_ports(spec_ports);
|
||||
loop->set_function(body);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "default_opset.hpp"
|
||||
#include "ngraph/axis_set.hpp"
|
||||
#include "ngraph/op/mvn.hpp"
|
||||
#include "ngraph/opsets/opset5.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
#include "op/mean_variance_normalization.hpp"
|
||||
|
||||
@@ -38,7 +39,7 @@ namespace ngraph
|
||||
bool normalize_variance =
|
||||
node.get_attribute_value<std::int64_t>("normalize_variance", 1);
|
||||
|
||||
return {std::make_shared<default_opset::MVN>(
|
||||
return {std::make_shared<ngraph::opset5::MVN>(
|
||||
data, across_channels, normalize_variance)};
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ngraph/builder/reduce_ops.hpp"
|
||||
#include "ngraph/builder/split.hpp"
|
||||
#include "ngraph/node.hpp"
|
||||
#include "ngraph/opsets/opset5.hpp"
|
||||
#include "onnx_import/core/node.hpp"
|
||||
#include "utils/common.hpp"
|
||||
#include "utils/reshape.hpp"
|
||||
@@ -84,7 +85,7 @@ namespace ngraph
|
||||
data, detail::create_group_norm_shape(data, num_groups), true);
|
||||
|
||||
auto mvn =
|
||||
std::make_shared<default_opset::MVN>(data_reshaped, false, true, eps);
|
||||
std::make_shared<ngraph::opset5::MVN>(data_reshaped, false, true, eps);
|
||||
std::shared_ptr<ngraph::Node> result =
|
||||
std::make_shared<default_opset::Reshape>(mvn, data_shape_node, true);
|
||||
|
||||
|
||||
@@ -681,7 +681,7 @@ tests_expected_to_fail = [
|
||||
"OnnxBackendNodeModelTest.test_squeeze_cpu",
|
||||
"OnnxBackendNodeModelTest.test_squeeze_negative_axes_cpu",),
|
||||
(xfail_issue_44976,
|
||||
"OnnxBackendNodeModelTest.test_quantizelinear_axis_cpu",)
|
||||
"OnnxBackendNodeModelTest.test_quantizelinear_axis_cpu",),
|
||||
]
|
||||
|
||||
for test_group in tests_expected_to_fail:
|
||||
|
||||
@@ -335,12 +335,12 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_the_proper_opset_in_subgraph)
|
||||
return std::string{op->get_type_name()} == "Loop";
|
||||
});
|
||||
const auto body_ops =
|
||||
ngraph::as_type_ptr<ngraph::opset5::Loop>(*loop_node_it)->get_function()->get_ops();
|
||||
ngraph::as_type_ptr<default_opset::Loop>(*loop_node_it)->get_function()->get_ops();
|
||||
const auto body_mul_node_it =
|
||||
std::find_if(body_ops.begin(), body_ops.end(), [](const std::shared_ptr<Node>& op) {
|
||||
return std::string{op->get_type_name()} == "Multiply";
|
||||
});
|
||||
const auto body_mul_node = ngraph::as_type_ptr<ngraph::opset5::Multiply>(*body_mul_node_it);
|
||||
const auto body_mul_node = ngraph::as_type_ptr<default_opset::Multiply>(*body_mul_node_it);
|
||||
EXPECT_TRUE(body_mul_node);
|
||||
EXPECT_EQ(
|
||||
body_mul_node->get_autob().m_type,
|
||||
|
||||
Reference in New Issue
Block a user