diff --git a/ngraph/python/setup.py b/ngraph/python/setup.py index 0cf109f10e4..373f1eb923f 100644 --- a/ngraph/python/setup.py +++ b/ngraph/python/setup.py @@ -189,10 +189,7 @@ sources = [ "pyngraph/node_output.cpp", "pyngraph/node_factory.cpp", "pyngraph/ops/constant.cpp", - "pyngraph/ops/get_output_element.cpp", - "pyngraph/ops/op.cpp", "pyngraph/ops/parameter.cpp", - "pyngraph/ops/regmodule_pyngraph_op.cpp", "pyngraph/ops/result.cpp", "pyngraph/ops/util/arithmetic_reduction.cpp", "pyngraph/ops/util/binary_elementwise_arithmetic.cpp", diff --git a/ngraph/python/src/ngraph/impl/op/__init__.py b/ngraph/python/src/ngraph/impl/op/__init__.py index 684750dadf2..3654f9b9450 100644 --- a/ngraph/python/src/ngraph/impl/op/__init__.py +++ b/ngraph/python/src/ngraph/impl/op/__init__.py @@ -32,6 +32,4 @@ from _pyngraph.op import Constant """ Constant.get_data = lambda self: np.array(self, copy=True) -from _pyngraph.op import GetOutputElement -from _pyngraph.op import Op from _pyngraph.op import Parameter diff --git a/ngraph/python/src/ngraph/opset1/ops.py b/ngraph/python/src/ngraph/opset1/ops.py index 4a3d3496d9f..4bd772bf33b 100644 --- a/ngraph/python/src/ngraph/opset1/ops.py +++ b/ngraph/python/src/ngraph/opset1/ops.py @@ -21,7 +21,7 @@ import numpy as np from functools import partial from ngraph.impl import Node, PartialShape, Shape -from ngraph.impl.op import Constant, GetOutputElement, Parameter +from ngraph.impl.op import Constant, Parameter from ngraph.opset_utils import _get_node_factory from ngraph.utils.decorators import binary_op, nameable_op, unary_op from ngraph.utils.input_validation import ( diff --git a/ngraph/python/src/ngraph/opset2/ops.py b/ngraph/python/src/ngraph/opset2/ops.py index e8f3dca11e4..2d01aa3295e 100644 --- a/ngraph/python/src/ngraph/opset2/ops.py +++ b/ngraph/python/src/ngraph/opset2/ops.py @@ -21,7 +21,7 @@ import numpy as np from functools import partial from ngraph.impl import Node, Shape -from ngraph.impl.op import Constant, GetOutputElement, Parameter +from ngraph.impl.op import Constant, Parameter from ngraph.opset_utils import _get_node_factory from ngraph.utils.decorators import binary_op, nameable_op, unary_op from ngraph.utils.input_validation import ( diff --git a/ngraph/python/src/ngraph/opset3/ops.py b/ngraph/python/src/ngraph/opset3/ops.py index 8b274e52f90..347a6b78b6c 100644 --- a/ngraph/python/src/ngraph/opset3/ops.py +++ b/ngraph/python/src/ngraph/opset3/ops.py @@ -21,7 +21,7 @@ import numpy as np from functools import partial from ngraph.impl import Node, Shape -from ngraph.impl.op import Constant, GetOutputElement, Parameter +from ngraph.impl.op import Constant, Parameter from ngraph.opset_utils import _get_node_factory from ngraph.utils.decorators import binary_op, nameable_op, unary_op from ngraph.utils.input_validation import ( diff --git a/ngraph/python/src/ngraph/opset4/ops.py b/ngraph/python/src/ngraph/opset4/ops.py index f2e74dddb42..69c3808c6d5 100644 --- a/ngraph/python/src/ngraph/opset4/ops.py +++ b/ngraph/python/src/ngraph/opset4/ops.py @@ -21,7 +21,7 @@ import numpy as np from functools import partial from ngraph.impl import Node, Shape -from ngraph.impl.op import Constant, GetOutputElement, Parameter +from ngraph.impl.op import Constant, Parameter from ngraph.opset_utils import _get_node_factory from ngraph.utils.decorators import binary_op, nameable_op, unary_op from ngraph.utils.input_validation import ( diff --git a/ngraph/python/src/ngraph/opset_utils.py b/ngraph/python/src/ngraph/opset_utils.py index 6b334a34d61..f487c72b63e 100644 --- a/ngraph/python/src/ngraph/opset_utils.py +++ b/ngraph/python/src/ngraph/opset_utils.py @@ -18,7 +18,6 @@ from typing import Optional import numpy as np from ngraph.impl import Node -from ngraph.impl.op import GetOutputElement from ngraph.utils.decorators import nameable_op from ngraph.utils.node_factory import NodeFactory from ngraph.utils.types import ( diff --git a/ngraph/python/src/pyngraph/ops/get_output_element.cpp b/ngraph/python/src/pyngraph/ops/get_output_element.cpp deleted file mode 100644 index 46d126225fe..00000000000 --- a/ngraph/python/src/pyngraph/ops/get_output_element.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#include -#include - -#include "ngraph/op/get_output_element.hpp" -#include "pyngraph/ops/get_output_element.hpp" - -namespace py = pybind11; - -void regclass_pyngraph_op_GetOutputElement(py::module m) -{ - py::class_, - ngraph::op::Op> - get_output_element(m, "GetOutputElement"); - get_output_element.doc() = "ngraph.impl.op.GetOutputElement wraps ngraph::op::GetOutputElement"; - get_output_element.def(py::init&, size_t>()); -} diff --git a/ngraph/python/src/pyngraph/ops/get_output_element.hpp b/ngraph/python/src/pyngraph/ops/get_output_element.hpp deleted file mode 100644 index 044c898661d..00000000000 --- a/ngraph/python/src/pyngraph/ops/get_output_element.hpp +++ /dev/null @@ -1,23 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#pragma once - -#include - -namespace py = pybind11; - -void regclass_pyngraph_op_GetOutputElement(py::module m); diff --git a/ngraph/python/src/pyngraph/ops/op.cpp b/ngraph/python/src/pyngraph/ops/op.cpp deleted file mode 100644 index 366a59a1337..00000000000 --- a/ngraph/python/src/pyngraph/ops/op.cpp +++ /dev/null @@ -1,31 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#include -#include - -#include "ngraph/op/op.hpp" -#include "pyngraph/ops/op.hpp" - -namespace py = pybind11; - -void regclass_pyngraph_op_Op(py::module m) -{ - py::class_, ngraph::Node> op(m, "Op"); - op.doc() = "ngraph.impl.op.Op wraps ngraph::op::Op"; - op.def_property( - "op_annotations", &ngraph::op::Op::get_op_annotations, &ngraph::op::Op::set_op_annotations); -} diff --git a/ngraph/python/src/pyngraph/ops/op.hpp b/ngraph/python/src/pyngraph/ops/op.hpp deleted file mode 100644 index e33f2994879..00000000000 --- a/ngraph/python/src/pyngraph/ops/op.hpp +++ /dev/null @@ -1,23 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#pragma once - -#include - -namespace py = pybind11; - -void regclass_pyngraph_op_Op(py::module m); diff --git a/ngraph/python/src/pyngraph/ops/regmodule_pyngraph_op.cpp b/ngraph/python/src/pyngraph/ops/regmodule_pyngraph_op.cpp deleted file mode 100644 index 2c396a31f02..00000000000 --- a/ngraph/python/src/pyngraph/ops/regmodule_pyngraph_op.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#include - -#include "pyngraph/ops/regmodule_pyngraph_op.hpp" - -namespace py = pybind11; - -void regmodule_pyngraph_op(py::module m_op) -{ - regclass_pyngraph_op_Constant(m_op); - regclass_pyngraph_op_GetOutputElement(m_op); - regclass_pyngraph_op_Parameter(m_op); - regclass_pyngraph_op_Result(m_op); -} diff --git a/ngraph/python/src/pyngraph/ops/regmodule_pyngraph_op.hpp b/ngraph/python/src/pyngraph/ops/regmodule_pyngraph_op.hpp deleted file mode 100644 index 3c4d2fe6767..00000000000 --- a/ngraph/python/src/pyngraph/ops/regmodule_pyngraph_op.hpp +++ /dev/null @@ -1,27 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#pragma once - -#include -#include "pyngraph/ops/constant.hpp" -#include "pyngraph/ops/get_output_element.hpp" -#include "pyngraph/ops/parameter.hpp" -#include "pyngraph/ops/result.hpp" - -namespace py = pybind11; - -void regmodule_pyngraph_op(py::module m); diff --git a/ngraph/python/src/pyngraph/ops/util/arithmetic_reduction.cpp b/ngraph/python/src/pyngraph/ops/util/arithmetic_reduction.cpp index 81ba3426782..8c40d1eb5df 100644 --- a/ngraph/python/src/pyngraph/ops/util/arithmetic_reduction.cpp +++ b/ngraph/python/src/pyngraph/ops/util/arithmetic_reduction.cpp @@ -26,9 +26,8 @@ namespace py = pybind11; void regclass_pyngraph_op_util_ArithmeticReduction(py::module m) { py::class_, - ngraph::op::Op> - arithmeticReduction(m, "ArithmeticRedection"); + std::shared_ptr> + arithmeticReduction(m, "ArithmeticReduction"); // arithmeticReduction.def(py::init&, // const ngraph::AxisSet& >()); diff --git a/ngraph/python/src/pyngraph/ops/util/binary_elementwise_arithmetic.cpp b/ngraph/python/src/pyngraph/ops/util/binary_elementwise_arithmetic.cpp index c2cd9622d64..c5548d83f1d 100644 --- a/ngraph/python/src/pyngraph/ops/util/binary_elementwise_arithmetic.cpp +++ b/ngraph/python/src/pyngraph/ops/util/binary_elementwise_arithmetic.cpp @@ -25,7 +25,6 @@ namespace py = pybind11; void regclass_pyngraph_op_util_BinaryElementwiseArithmetic(py::module m) { py::class_, - ngraph::op::Op> + std::shared_ptr> binaryElementwiseArithmetic(m, "BinaryElementwiseArithmetic"); } diff --git a/ngraph/python/src/pyngraph/ops/util/binary_elementwise_comparison.cpp b/ngraph/python/src/pyngraph/ops/util/binary_elementwise_comparison.cpp index e84e6ae2752..0143f3e368b 100644 --- a/ngraph/python/src/pyngraph/ops/util/binary_elementwise_comparison.cpp +++ b/ngraph/python/src/pyngraph/ops/util/binary_elementwise_comparison.cpp @@ -25,7 +25,6 @@ namespace py = pybind11; void regclass_pyngraph_op_util_BinaryElementwiseComparison(py::module m) { py::class_, - ngraph::op::Op> + std::shared_ptr> binaryElementwiseComparison(m, "BinaryElementwiseComparison"); } diff --git a/ngraph/python/src/pyngraph/ops/util/binary_elementwise_logical.cpp b/ngraph/python/src/pyngraph/ops/util/binary_elementwise_logical.cpp index 17fdce4130a..f354f032c99 100644 --- a/ngraph/python/src/pyngraph/ops/util/binary_elementwise_logical.cpp +++ b/ngraph/python/src/pyngraph/ops/util/binary_elementwise_logical.cpp @@ -25,7 +25,6 @@ namespace py = pybind11; void regclass_pyngraph_op_util_BinaryElementwiseLogical(py::module m) { py::class_, - ngraph::op::Op> + std::shared_ptr> binaryElementwiseLogical(m, "BinaryElementwiseLogical"); } diff --git a/ngraph/python/src/pyngraph/ops/util/index_reduction.cpp b/ngraph/python/src/pyngraph/ops/util/index_reduction.cpp index 65456af056a..fbfc51c5eed 100644 --- a/ngraph/python/src/pyngraph/ops/util/index_reduction.cpp +++ b/ngraph/python/src/pyngraph/ops/util/index_reduction.cpp @@ -25,9 +25,7 @@ namespace py = pybind11; void regclass_pyngraph_op_util_IndexReduction(py::module m) { - py::class_, - ngraph::op::Op> + py::class_> indexReduction(m, "IndexRedection"); indexReduction.def_property_readonly("reduction_axis", &ngraph::op::util::IndexReduction::get_reduction_axis); diff --git a/ngraph/python/src/pyngraph/ops/util/unary_elementwise_arithmetic.cpp b/ngraph/python/src/pyngraph/ops/util/unary_elementwise_arithmetic.cpp index 0de88df5256..ec47dd1c1b9 100644 --- a/ngraph/python/src/pyngraph/ops/util/unary_elementwise_arithmetic.cpp +++ b/ngraph/python/src/pyngraph/ops/util/unary_elementwise_arithmetic.cpp @@ -25,7 +25,6 @@ namespace py = pybind11; void regclass_pyngraph_op_util_UnaryElementwiseArithmetic(py::module m) { py::class_, - ngraph::op::Op> + std::shared_ptr> unaryElementwiseArithmetic(m, "UnaryElementwiseArithmetic"); } diff --git a/ngraph/python/src/pyngraph/pyngraph.cpp b/ngraph/python/src/pyngraph/pyngraph.cpp index 1d0202cb41b..712bc492e0a 100644 --- a/ngraph/python/src/pyngraph/pyngraph.cpp +++ b/ngraph/python/src/pyngraph/pyngraph.cpp @@ -28,8 +28,9 @@ #include "pyngraph/onnx_import/onnx_import.hpp" #endif #include "pyngraph/dimension.hpp" -#include "pyngraph/ops/op.hpp" -#include "pyngraph/ops/regmodule_pyngraph_op.hpp" +#include "pyngraph/ops/constant.hpp" +#include "pyngraph/ops/parameter.hpp" +#include "pyngraph/ops/result.hpp" #include "pyngraph/ops/util/regmodule_pyngraph_op_util.hpp" #include "pyngraph/partial_shape.hpp" #include "pyngraph/passes/regmodule_pyngraph_passes.hpp" @@ -60,12 +61,13 @@ PYBIND11_MODULE(_pyngraph, m) regclass_pyngraph_Function(m); regclass_pyngraph_Serializer(m); py::module m_op = m.def_submodule("op", "Package ngraph.impl.op that wraps ngraph::op"); - regclass_pyngraph_op_Op(m_op); + regclass_pyngraph_op_Constant(m_op); + regclass_pyngraph_op_Parameter(m_op); + regclass_pyngraph_op_Result(m_op); #if defined(NGRAPH_ONNX_IMPORT_ENABLE) regmodule_pyngraph_onnx_import(m); #endif regmodule_pyngraph_op_util(m_op); - regmodule_pyngraph_op(m_op); regmodule_pyngraph_passes(m); regmodule_pyngraph_util(m); } diff --git a/ngraph/python/src/pyngraph/types/regmodule_pyngraph_types.cpp b/ngraph/python/src/pyngraph/types/regmodule_pyngraph_types.cpp index e046002e422..4271a158317 100644 --- a/ngraph/python/src/pyngraph/types/regmodule_pyngraph_types.cpp +++ b/ngraph/python/src/pyngraph/types/regmodule_pyngraph_types.cpp @@ -22,6 +22,5 @@ namespace py = pybind11; void regmodule_pyngraph_types(py::module m) { - // regclass_pyngraph_TensorViewType(m); regclass_pyngraph_Type(m); } diff --git a/ngraph/python/src/pyngraph/types/type.hpp b/ngraph/python/src/pyngraph/types/type.hpp deleted file mode 100644 index 4364aa0eee6..00000000000 --- a/ngraph/python/src/pyngraph/types/type.hpp +++ /dev/null @@ -1,23 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#pragma once - -#include - -namespace py = pybind11; - -void regclass_pyngraph_TensorViewType(py::module m);