Skip to content

Commit 869cbe4

Browse files
authored
Removed opset0 from public API (#1144)
1 parent 027be06 commit 869cbe4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+117
-109
lines changed

ngraph/src/ngraph/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,6 @@ set (SRC
589589
pass/nop_elimination.hpp
590590
pass/pass.cpp
591591
pass/pass.hpp
592-
pass/opset1_downgrade.cpp
593-
pass/opset1_downgrade.hpp
594-
pass/opset1_upgrade.cpp
595-
pass/opset1_upgrade.hpp
596592
pass/pass_config.cpp
597593
pass/pass_config.hpp
598594
pass/propagate_cacheability.cpp

ngraph/src/ngraph/builder/reshape.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace ngraph
3434
///
3535
/// \return The reshaped value.
3636
///
37+
NGRAPH_API
3738
std::shared_ptr<Node> reshape(const Output<Node>& value, const Shape& shape);
3839

3940
/// \brief Permute axes according to specified axes_order parameter.

ngraph/src/ngraph/frontend/onnx_import/CMakeLists.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ add_library(onnx_importer SHARED
7878
op/constant_of_shape.hpp
7979
op/conv.cpp
8080
op/conv.hpp
81-
op/conv_integer.cpp
82-
op/conv_integer.hpp
81+
# op/conv_integer.cpp
82+
# op/conv_integer.hpp
8383
op/conv_transpose.cpp
8484
op/conv_transpose.hpp
8585
op/cum_sum.cpp
8686
op/cum_sum.hpp
8787
op/depth_to_space.cpp
8888
op/depth_to_space.hpp
89-
op/dequantize_linear.cpp
90-
op/dequantize_linear.hpp
89+
# op/dequantize_linear.cpp
90+
# op/dequantize_linear.hpp
9191
op/div.hpp
9292
op/dropout.hpp
9393
op/elu.cpp
@@ -103,8 +103,8 @@ add_library(onnx_importer SHARED
103103
op/flatten.hpp
104104
op/floor.hpp
105105
op/gather.hpp
106-
op/gather_nd.hpp
107-
op/gather_nd.cpp
106+
# op/gather_nd.hpp
107+
# op/gather_nd.cpp
108108
op/gemm.cpp
109109
op/gemm.hpp
110110
op/global_average_pool.cpp
@@ -168,10 +168,10 @@ add_library(onnx_importer SHARED
168168
op/prelu.hpp
169169
op/qlinear_matmul.cpp
170170
op/qlinear_matmul.hpp
171-
op/quant_conv.cpp
172-
op/quant_conv.hpp
173-
op/quantize_linear.cpp
174-
op/quantize_linear.hpp
171+
# op/quant_conv.cpp
172+
# op/quant_conv.hpp
173+
# op/quantize_linear.cpp
174+
# op/quantize_linear.hpp
175175
op/range.cpp
176176
op/range.hpp
177177
op/reciprocal.cpp
@@ -189,10 +189,10 @@ add_library(onnx_importer SHARED
189189
op/rnn.hpp
190190
op/roi_align.cpp
191191
op/roi_align.hpp
192-
op/round.cpp
193-
op/round.hpp
194-
op/scatter_nd.cpp
195-
op/scatter_nd.hpp
192+
# op/round.cpp
193+
# op/round.hpp
194+
# op/scatter_nd.cpp
195+
# op/scatter_nd.hpp
196196
op/scatter_elements.cpp
197197
op/scatter_elements.hpp
198198
op/selu.cpp

ngraph/src/ngraph/frontend/onnx_import/op/batch_norm.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "core/null_node.hpp"
2222
#include "default_opset.hpp"
2323
#include "exceptions.hpp"
24-
#include "ngraph/opsets/opset0.hpp"
2524

2625
namespace ngraph
2726
{
@@ -65,12 +64,14 @@ namespace ngraph
6564
saved_var};
6665
}
6766

68-
return {std::make_shared<ngraph::opset0::BatchNormTraining>(
69-
x, scale, bias, epsilon),
70-
after_bn_mean,
71-
after_bn_var,
72-
saved_mean,
73-
saved_var};
67+
throw ngraph_error(
68+
"Cannot create nGraph batch norm with unsupported number of inputs");
69+
// return {std::make_shared<ngraph::opset0::BatchNormTraining>(
70+
// x, scale, bias, epsilon),
71+
// after_bn_mean,
72+
// after_bn_var,
73+
// saved_mean,
74+
// saved_var};
7475
}
7576

7677
} // namespace set_1

ngraph/src/ngraph/frontend/onnx_import/op/conv.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "ngraph/op/fused/group_conv.hpp"
2626
#include "ngraph/op/slice.hpp"
2727
#include "ngraph/op/util/attr_types.hpp"
28-
#include "ngraph/opsets/opset0.hpp"
2928
#include "utils/convpool.hpp"
3029

3130
namespace ngraph

ngraph/src/ngraph/frontend/onnx_import/op/hardmax.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "ngraph/builder/reshape.hpp"
2020
#include "ngraph/op/one_hot.hpp"
2121
#include "ngraph/op/topk.hpp"
22-
#include "ngraph/opsets/opset0.hpp"
2322
#include "ngraph/validation_util.hpp"
2423
#include "utils/common.hpp"
2524
#include "utils/reshape.hpp"
@@ -57,22 +56,20 @@ namespace ngraph
5756
row_size = ngraph::onnx_import::reshape::interpret_as_scalar(row_size);
5857

5958
const auto indices_axis = 1;
60-
const auto max_indices = std::make_shared<opset0::GetOutputElement>(
61-
std::make_shared<default_opset::TopK>(
62-
coerced_tensor,
63-
default_opset::Constant::create(ngraph::element::i64, Shape{}, {1}),
64-
indices_axis,
65-
default_opset::TopK::Mode::MAX,
66-
default_opset::TopK::SortType::NONE),
67-
1);
59+
const auto topk = std::make_shared<default_opset::TopK>(
60+
coerced_tensor,
61+
default_opset::Constant::create(ngraph::element::i64, Shape{}, {1}),
62+
indices_axis,
63+
default_opset::TopK::Mode::MAX,
64+
default_opset::TopK::SortType::NONE);
6865

6966
const auto on_value =
7067
default_opset::Constant::create(ngraph::element::i64, Shape{}, {1});
7168
const auto off_value =
7269
default_opset::Constant::create(ngraph::element::i64, Shape{}, {0});
7370

7471
const auto results = std::make_shared<default_opset::OneHot>(
75-
max_indices, row_size, on_value, off_value, indices_axis);
72+
topk->output(1), row_size, on_value, off_value, indices_axis);
7673
const auto converted_results = std::make_shared<default_opset::Convert>(
7774
results, input->get_element_type());
7875

ngraph/src/ngraph/frontend/onnx_import/op/mean_variance_normalization.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "mean_variance_normalization.hpp"
2121
#include "ngraph/axis_set.hpp"
2222
#include "ngraph/op/fused/mvn.hpp"
23-
#include "ngraph/opsets/opset0.hpp"
2423
#include "ngraph/validation_util.hpp"
2524

2625
namespace ngraph

ngraph/src/ngraph/frontend/onnx_import/op/topk.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "default_opset.hpp"
2121
#include "ngraph/node.hpp"
2222
#include "ngraph/op/constant.hpp"
23+
#include "ngraph/op/get_output_element.hpp"
2324
#include "ngraph/op/topk.hpp"
24-
#include "ngraph/opsets/opset0.hpp"
2525
#include "ngraph/shape.hpp"
2626
#include "ngraph/type/element_type.hpp"
2727
#include "ngraph/validation_util.hpp"
@@ -55,9 +55,9 @@ namespace
5555
ngraph::NodeVector get_outputs(const std::shared_ptr<ngraph::Node>& node)
5656
{
5757
std::shared_ptr<ngraph::Node> values =
58-
std::make_shared<ngraph::opset0::GetOutputElement>(node, 0);
58+
std::make_shared<ngraph::op::v0::GetOutputElement>(node, 0);
5959
std::shared_ptr<ngraph::Node> indices =
60-
std::make_shared<ngraph::opset0::GetOutputElement>(node, 1);
60+
std::make_shared<ngraph::op::v0::GetOutputElement>(node, 1);
6161

6262
return {values, indices};
6363
}

ngraph/src/ngraph/frontend/onnx_import/ops_bridge.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
#include "op/constant.hpp"
4343
#include "op/constant_of_shape.hpp"
4444
#include "op/conv.hpp"
45-
#include "op/conv_integer.hpp"
45+
// #include "op/conv_integer.hpp"
4646
#include "op/conv_transpose.hpp"
4747
#include "op/cos.hpp"
4848
#include "op/cosh.hpp"
4949
#include "op/cum_sum.hpp"
5050
#include "op/depth_to_space.hpp"
51-
#include "op/dequantize_linear.hpp"
51+
// #include "op/dequantize_linear.hpp"
5252
#include "op/div.hpp"
5353
#include "op/dropout.hpp"
5454
#include "op/elu.hpp"
@@ -60,7 +60,7 @@
6060
#include "op/flatten.hpp"
6161
#include "op/floor.hpp"
6262
#include "op/gather.hpp"
63-
#include "op/gather_nd.hpp"
63+
// #include "op/gather_nd.hpp"
6464
#include "op/gemm.hpp"
6565
#include "op/global_average_pool.hpp"
6666
#include "op/global_max_pool.hpp"
@@ -98,8 +98,8 @@
9898
#include "op/pow.hpp"
9999
#include "op/prelu.hpp"
100100
#include "op/qlinear_matmul.hpp"
101-
#include "op/quant_conv.hpp"
102-
#include "op/quantize_linear.hpp"
101+
// #include "op/quant_conv.hpp"
102+
// #include "op/quantize_linear.hpp"
103103
#include "op/range.hpp"
104104
#include "op/reciprocal.hpp"
105105
#include "op/reduce.hpp"
@@ -109,9 +109,9 @@
109109
#include "op/reverse_sequence.hpp"
110110
#include "op/rnn.hpp"
111111
#include "op/roi_align.hpp"
112-
#include "op/round.hpp"
112+
// #include "op/round.hpp"
113113
#include "op/scatter_elements.hpp"
114-
#include "op/scatter_nd.hpp"
114+
// #include "op/scatter_nd.hpp"
115115
#include "op/selu.hpp"
116116
#include "op/shape.hpp"
117117
#include "op/shrink.hpp"
@@ -271,13 +271,13 @@ namespace ngraph
271271
REGISTER_OPERATOR("Constant", 1, constant);
272272
REGISTER_OPERATOR("ConstantOfShape", 1, constant_of_shape);
273273
REGISTER_OPERATOR("Conv", 1, conv);
274-
REGISTER_OPERATOR("ConvInteger", 1, conv_integer);
274+
// REGISTER_OPERATOR("ConvInteger", 1, conv_integer);
275275
REGISTER_OPERATOR("ConvTranspose", 1, conv_transpose);
276276
REGISTER_OPERATOR("Cos", 1, cos);
277277
REGISTER_OPERATOR("Cosh", 1, cosh);
278278
REGISTER_OPERATOR("CumSum", 1, cum_sum);
279279
REGISTER_OPERATOR("DepthToSpace", 1, depth_to_space);
280-
REGISTER_OPERATOR("DequantizeLinear", 1, dequantize_linear);
280+
// REGISTER_OPERATOR("DequantizeLinear", 1, dequantize_linear);
281281
REGISTER_OPERATOR("Div", 1, div);
282282
REGISTER_OPERATOR("Div", 7, div);
283283
REGISTER_OPERATOR("Dropout", 1, dropout);
@@ -290,7 +290,7 @@ namespace ngraph
290290
REGISTER_OPERATOR("Flatten", 1, flatten);
291291
REGISTER_OPERATOR("Floor", 1, floor);
292292
REGISTER_OPERATOR("Gather", 1, gather);
293-
REGISTER_OPERATOR("GatherND", 1, gather_nd);
293+
// REGISTER_OPERATOR("GatherND", 1, gather_nd);
294294
REGISTER_OPERATOR("Gemm", 1, gemm);
295295
REGISTER_OPERATOR("Gemm", 6, gemm);
296296
REGISTER_OPERATOR("GlobalAveragePool", 1, global_average_pool);
@@ -333,9 +333,9 @@ namespace ngraph
333333
REGISTER_OPERATOR("Pad", 11, pad);
334334
REGISTER_OPERATOR("Pow", 1, pow);
335335
REGISTER_OPERATOR("PRelu", 1, prelu);
336-
REGISTER_OPERATOR("QLinearConv", 1, quant_conv);
336+
// REGISTER_OPERATOR("QLinearConv", 1, quant_conv);
337337
REGISTER_OPERATOR("QLinearMatMul", 1, qlinear_matmul);
338-
REGISTER_OPERATOR("QuantizeLinear", 1, quantize_linear);
338+
// REGISTER_OPERATOR("QuantizeLinear", 1, quantize_linear);
339339
REGISTER_OPERATOR("Range", 1, range);
340340
REGISTER_OPERATOR("Reciprocal", 1, reciprocal);
341341
REGISTER_OPERATOR("ReduceLogSum", 1, reduce_log_sum);
@@ -354,10 +354,10 @@ namespace ngraph
354354
REGISTER_OPERATOR("ReverseSequence", 1, reverse_sequence);
355355
REGISTER_OPERATOR("RNN", 1, rnn);
356356
REGISTER_OPERATOR("RoiAlign", 1, roi_align);
357-
REGISTER_OPERATOR("Round", 1, round);
357+
// REGISTER_OPERATOR("Round", 1, round);
358358
REGISTER_OPERATOR("Scatter", 1, scatter_elements);
359359
REGISTER_OPERATOR("ScatterElements", 1, scatter_elements);
360-
REGISTER_OPERATOR("ScatterND", 1, scatter_nd);
360+
// REGISTER_OPERATOR("ScatterND", 1, scatter_nd);
361361
REGISTER_OPERATOR("Selu", 1, selu);
362362
REGISTER_OPERATOR("Shape", 1, shape);
363363
REGISTER_OPERATOR("Shrink", 1, shrink);

ngraph/src/ngraph/frontend/onnx_import/utils/arg_min_max_factory.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "utils/arg_min_max_factory.hpp"
1818
#include "default_opset.hpp"
1919
#include "ngraph/op/get_output_element.hpp"
20-
#include "ngraph/opsets/opset0.hpp"
2120
#include "ngraph/validation_util.hpp"
2221

2322
namespace ngraph
@@ -51,18 +50,16 @@ namespace ngraph
5150
const auto topk = std::make_shared<default_opset::TopK>(
5251
m_input_node, k_node, m_axis, mode, default_opset::TopK::SortType::NONE);
5352

54-
const auto indices = std::make_shared<ngraph::opset0::GetOutputElement>(topk, 1);
55-
5653
if (m_keep_dims == 0)
5754
{
5855
const auto axis_to_remove =
5956
default_opset::Constant::create(element::u64, Shape{}, {topk->get_axis()});
6057
const auto reshaped_indices =
61-
std::make_shared<default_opset::Squeeze>(indices, axis_to_remove);
58+
std::make_shared<default_opset::Squeeze>(topk->output(1), axis_to_remove);
6259

6360
return std::make_shared<default_opset::Convert>(reshaped_indices, element::i64);
6461
}
65-
return std::make_shared<default_opset::Convert>(indices, element::i64);
62+
return std::make_shared<default_opset::Convert>(topk->output(1), element::i64);
6663
}
6764
}
6865
}

ngraph/src/ngraph/opsets/opset.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,6 @@ ngraph::Node* ngraph::OpSet::create_insensitive(const std::string& name) const
4444
: m_factory_registry.create(type_info_it->second);
4545
}
4646

47-
const ngraph::OpSet& ngraph::get_opset0()
48-
{
49-
static std::mutex init_mutex;
50-
static OpSet opset;
51-
if (opset.size() == 0)
52-
{
53-
std::lock_guard<std::mutex> guard(init_mutex);
54-
if (opset.size() == 0)
55-
{
56-
#define NGRAPH_OP(NAME, NAMESPACE) opset.insert<NAMESPACE::NAME>();
57-
#include "ngraph/opsets/opset0_tbl.hpp"
58-
#undef NGRAPH_OP
59-
}
60-
}
61-
return opset;
62-
}
63-
6447
const ngraph::OpSet& ngraph::get_opset1()
6548
{
6649
static std::mutex init_mutex;

ngraph/test/onnx/onnx_import_provenance.in.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#include "ngraph/file_util.hpp"
1919
#include "ngraph/frontend/onnx_import/default_opset.hpp"
2020
#include "ngraph/frontend/onnx_import/onnx.hpp"
21-
#include "ngraph/opsets/opset0.hpp"
2221
#include "ngraph/pass/manager.hpp"
23-
#include "ngraph/pass/opset1_downgrade.hpp"
2422
#include "ngraph/provenance.hpp"
23+
#include "opset0.hpp"
2524
#include "opset0_downgrade.hpp"
25+
#include "opset1_downgrade.hpp"
2626
#include "util/provenance_enabler.hpp"
2727
#include "util/test_control.hpp"
2828
#include "util/type_prop.hpp"

ngraph/test/op_is.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,6 @@ namespace
13511351
TEST(op_is, check)
13521352
{
13531353
#define NGRAPH_OP(a, b) op_is_##a();
1354-
#include "ngraph/opsets/opset0_tbl.hpp"
1354+
#include "opset0_tbl.hpp"
13551355
#undef NGRAPH_OP
13561356
}

ngraph/test/opset_pass/binary_elementwise_opset_pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include "ngraph/ngraph.hpp"
55
#include "ngraph/pass/manager.hpp"
6-
#include "ngraph/pass/opset1_upgrade.hpp"
76
#include "opset0_downgrade.hpp"
7+
#include "opset1_upgrade.hpp"
88
#include "util/test_control.hpp"
99
#include "util/type_prop.hpp"
1010

ngraph/test/opset_pass/broadcast_opset_pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include "ngraph/ngraph.hpp"
55
#include "ngraph/op/util/attr_types.hpp"
66
#include "ngraph/pass/manager.hpp"
7-
#include "ngraph/pass/opset1_upgrade.hpp"
87
#include "opset0_downgrade.hpp"
8+
#include "opset1_upgrade.hpp"
99
#include "util/type_prop.hpp"
1010

1111
using namespace std;

ngraph/test/opset_pass/convolution_opset_pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include "ngraph/ngraph.hpp"
55
#include "ngraph/pass/manager.hpp"
6-
#include "ngraph/pass/opset1_upgrade.hpp"
76
#include "opset0_downgrade.hpp"
7+
#include "opset1_upgrade.hpp"
88
#include "util/test_control.hpp"
99
#include "util/type_prop.hpp"
1010

ngraph/test/opset_pass/gather_opset_pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "ngraph/ngraph.hpp"
2121
#include "ngraph/pass/manager.hpp"
22-
#include "ngraph/pass/opset1_upgrade.hpp"
22+
#include "opset1_upgrade.hpp"
2323
#include "util/type_prop.hpp"
2424

2525
using namespace std;

0 commit comments

Comments
 (0)