Operation Greater, Less, Equal were added.
Signed-off-by: Dmitry Gusev <d.gusev@partner.samsung.com>
Op/ConvTranspose.h
Op/Dropout.cpp
Op/Dropout.h
+ Op/Equal.cpp
+ Op/Equal.h
Op/Flatten.cpp
Op/Flatten.h
Op/Gather.cpp
Op/Gather.h
+ Op/Greater.cpp
+ Op/Greater.h
Op/Gemm.cpp
Op/Gemm.h
Op/Identity.cpp
Op/Identity.h
+ Op/Less.cpp
+ Op/Less.h
Op/MatMul.cpp
Op/MatMul.h
Op/GlobalAveragePool.cpp
#include "Op/Conv.h"
#include "Op/ConvTranspose.h"
#include "Op/Dropout.h"
+#include "Op/Equal.h"
#include "Op/Flatten.h"
#include "Op/Gather.h"
+#include "Op/Greater.h"
#include "Op/Gemm.h"
#include "Op/GlobalAveragePool.h"
#include "Op/Identity.h"
+#include "Op/Less.h"
#include "Op/MatMul.h"
#include "Op/Max.h"
#include "Op/MaxPool.h"
registry.registerConverter("Conv", stdex::make_unique<ConvNodeConverter>());
registry.registerConverter("ConvTranspose", stdex::make_unique<ConvTransposeNodeConverter>());
registry.registerConverter("Dropout", stdex::make_unique<DropoutNodeConverter>());
+ registry.registerConverter("Equal", stdex::make_unique<EqualNodeConverter>());
registry.registerConverter("Flatten", stdex::make_unique<FlattenNodeConverter>());
registry.registerConverter("Gather", stdex::make_unique<GatherNodeConverter>());
+ registry.registerConverter("Greater", stdex::make_unique<GreaterNodeConverter>());
registry.registerConverter("Gemm", stdex::make_unique<GemmNodeConverter>());
registry.registerConverter("GlobalAveragePool",
stdex::make_unique<GlobalAveragePoolNodeConverter>());
registry.registerConverter("Identity", stdex::make_unique<IdentityNodeConverter>());
+ registry.registerConverter("Less", stdex::make_unique<LessNodeConverter>());
registry.registerConverter("MatMul", stdex::make_unique<MatMulNodeConverter>());
registry.registerConverter("Max", stdex::make_unique<MaxNodeConverter>());
registry.registerConverter("MaxPool", stdex::make_unique<MaxPoolNodeConverter>());
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * 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 "Equal.h"
+
+#include "ONNXHelpers.h"
+#include "AttributeHelpers.h"
+
+#include "mir/ops/EqualOp.h"
+
+namespace mir_onnx
+{
+
+void EqualNodeConverter::convert(const onnx::NodeProto &onnx_node, ConverterContext *context) const
+{
+ std::vector<mir::Operation::Output *> inputs = context->getNodeInputs(onnx_node);
+ mir::Graph *graph = context->getGraph();
+
+ auto result = createOp<mir::ops::EqualOp>(graph, inputs[0], inputs[1])->getOutput(0);
+
+ context->setNodeOutputs(onnx_node, {result});
+}
+
+} // namespace mir_onnx
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef MIR_ONNX_OP_EQUAL_H
+#define MIR_ONNX_OP_EQUAL_H
+
+#include "ONNXNodeConverterRegistry.h"
+
+namespace mir_onnx
+{
+
+class EqualNodeConverter : public NodeConverter
+{
+public:
+ void convert(const onnx::NodeProto &onnx_node, ConverterContext *context) const override;
+};
+
+} // namespace mir_onnx
+
+#endif // MIR_ONNX_OP_EQUAL_H
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * 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 "Greater.h"
+
+#include "ONNXHelpers.h"
+#include "AttributeHelpers.h"
+
+#include "mir/ops/GreaterOp.h"
+
+namespace mir_onnx
+{
+
+void GreaterNodeConverter::convert(const onnx::NodeProto &onnx_node,
+ ConverterContext *context) const
+{
+ std::vector<mir::Operation::Output *> inputs = context->getNodeInputs(onnx_node);
+ mir::Graph *graph = context->getGraph();
+
+ auto result = createOp<mir::ops::GreaterOp>(graph, inputs[0], inputs[1])->getOutput(0);
+
+ context->setNodeOutputs(onnx_node, {result});
+}
+
+} // namespace mir_onnx
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef MIR_ONNX_OP_GREATER_H
+#define MIR_ONNX_OP_GREATER_H
+
+#include "ONNXNodeConverterRegistry.h"
+
+namespace mir_onnx
+{
+
+class GreaterNodeConverter : public NodeConverter
+{
+public:
+ void convert(const onnx::NodeProto &onnx_node, ConverterContext *context) const override;
+};
+
+} // namespace mir_onnx
+
+#endif // MIR_ONNX_OP_GREATER_H
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * 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 "Less.h"
+
+#include "ONNXHelpers.h"
+#include "AttributeHelpers.h"
+
+#include "mir/ops/LessOp.h"
+
+namespace mir_onnx
+{
+
+void LessNodeConverter::convert(const onnx::NodeProto &onnx_node, ConverterContext *context) const
+{
+ std::vector<mir::Operation::Output *> inputs = context->getNodeInputs(onnx_node);
+ mir::Graph *graph = context->getGraph();
+
+ auto result = createOp<mir::ops::LessOp>(graph, inputs[0], inputs[1])->getOutput(0);
+
+ context->setNodeOutputs(onnx_node, {result});
+}
+
+} // namespace mir_onnx
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef MIR_ONNX_OP_LESS_H
+#define MIR_ONNX_OP_LESS_H
+
+#include "ONNXNodeConverterRegistry.h"
+
+namespace mir_onnx
+{
+
+class LessNodeConverter : public NodeConverter
+{
+public:
+ void convert(const onnx::NodeProto &onnx_node, ConverterContext *context) const override;
+};
+
+} // namespace mir_onnx
+
+#endif // MIR_ONNX_OP_LESS_H