From f9b27c3714ea987a5c8b8e5644f008496e1255cc Mon Sep 17 00:00:00 2001 From: Tomasz Socha Date: Mon, 7 Jun 2021 13:01:20 +0200 Subject: [PATCH] =?UTF-8?q?[ONNX]=20=F0=9F=9B=A0=EF=B8=8F=F0=9F=95=B8?= =?UTF-8?q?=EF=B8=8F=20Fix=20softmax=20opsets=20(#5959)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ngraph/frontend/onnx_import/src/op/softmax.cpp | 4 ++-- ngraph/frontend/onnx_import/src/op/softmax.hpp | 4 ++-- ngraph/frontend/onnx_import/src/ops_bridge.cpp | 4 +--- ngraph/python/tests/__init__.py | 2 +- ngraph/python/tests/test_onnx/test_zoo_models.py | 4 +++- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ngraph/frontend/onnx_import/src/op/softmax.cpp b/ngraph/frontend/onnx_import/src/op/softmax.cpp index 1827799b8e3..21b23783d19 100644 --- a/ngraph/frontend/onnx_import/src/op/softmax.cpp +++ b/ngraph/frontend/onnx_import/src/op/softmax.cpp @@ -69,7 +69,7 @@ namespace ngraph return {result}; } } // namespace set_1 - namespace set_7 + namespace set_11 { OutputVector softmax(const Node& node) { @@ -109,7 +109,7 @@ namespace ngraph return {result}; } - } // namespace set_7 + } // namespace set_11 namespace set_13 { OutputVector softmax(const Node& node) diff --git a/ngraph/frontend/onnx_import/src/op/softmax.hpp b/ngraph/frontend/onnx_import/src/op/softmax.hpp index 5528f3dd259..1878c2045fd 100644 --- a/ngraph/frontend/onnx_import/src/op/softmax.hpp +++ b/ngraph/frontend/onnx_import/src/op/softmax.hpp @@ -19,11 +19,11 @@ namespace ngraph } // namespace set_1 - namespace set_7 + namespace set_11 { OutputVector softmax(const Node& node); - } // namespace set_7 + } // namespace set_11 namespace set_13 { diff --git a/ngraph/frontend/onnx_import/src/ops_bridge.cpp b/ngraph/frontend/onnx_import/src/ops_bridge.cpp index 511c059c61b..b807a31212d 100644 --- a/ngraph/frontend/onnx_import/src/ops_bridge.cpp +++ b/ngraph/frontend/onnx_import/src/ops_bridge.cpp @@ -437,9 +437,7 @@ namespace ngraph REGISTER_OPERATOR("Slice", 1, slice); REGISTER_OPERATOR("Slice", 10, slice); REGISTER_OPERATOR("Softmax", 1, softmax); - // Softmax v7 should be in the 11th opset but, - // other frameworks(mxnet and onnxruntime) already use for older models. - REGISTER_OPERATOR("Softmax", 7, softmax); + REGISTER_OPERATOR("Softmax", 11, softmax); REGISTER_OPERATOR("Softmax", 13, softmax); REGISTER_OPERATOR("Softplus", 1, softplus); REGISTER_OPERATOR("Softsign", 1, softsign); diff --git a/ngraph/python/tests/__init__.py b/ngraph/python/tests/__init__.py index 5ec9abe7a7b..930be465a63 100644 --- a/ngraph/python/tests/__init__.py +++ b/ngraph/python/tests/__init__.py @@ -149,5 +149,5 @@ xfail_issue_49753 = xfail_test(reason="RuntimeError: Unsupported dynamic ops: v1 xfail_issue_49754 = xfail_test(reason="RuntimeError: Unsupported dynamic ops: v1::TopKIE") xfail_issue_52463 = xfail_test(reason="test_operator_add_size1_singleton_broadcast_cpu - " "Not equal to tolerance") - xfail_issue_45432 = xfail_test(reason="Einsum is not implemented in CPU plugin.") +xfail_issue_onnx_models_140 = xfail_test(reason="https://github.com/onnx/models/issues/140") diff --git a/ngraph/python/tests/test_onnx/test_zoo_models.py b/ngraph/python/tests/test_onnx/test_zoo_models.py index 449ad50457a..1954b61e646 100644 --- a/ngraph/python/tests/test_onnx/test_zoo_models.py +++ b/ngraph/python/tests/test_onnx/test_zoo_models.py @@ -25,7 +25,8 @@ from tests import ( xfail_issue_47430, xfail_issue_47495, xfail_issue_48145, - xfail_issue_48190) + xfail_issue_48190, + xfail_issue_onnx_models_140) MODELS_ROOT_DIR = tests.MODEL_ZOO_DIR @@ -170,6 +171,7 @@ if len(zoo_models) > 0: (xfail_issue_47430, "test_onnx_model_zoo_vision_object_detection_segmentation_fcn_model_fcn_resnet101_11_fcn_resnet101_11_model_cpu"), (xfail_issue_48145, "test_onnx_model_zoo_text_machine_comprehension_bert_squad_model_bertsquad_8_download_sample_8_bertsquad8_cpu"), (xfail_issue_48190, "test_onnx_model_zoo_text_machine_comprehension_roberta_model_roberta_base_11_roberta_base_11_roberta_base_11_cpu"), + (xfail_issue_onnx_models_140, "test_onnx_model_zoo_vision_object_detection_segmentation_duc_model_ResNet101_DUC_7_ResNet101_DUC_HDC_ResNet101_DUC_HDC_cpu"), # Model MSFT (xfail_issue_37973, "test_MSFT_opset7_tf_inception_v2_model_cpu"),