Tests and docs for registering custom ONNX operators (#2416)
authorMateusz Tabaka <mateusz.tabaka@intel.com>
Mon, 12 Oct 2020 04:36:19 +0000 (06:36 +0200)
committerGitHub <noreply@github.com>
Mon, 12 Oct 2020 04:36:19 +0000 (07:36 +0300)
commit24b2c41f3a4f8c577ac9631df44d521d1196874f
tree697181949de7cd7e909eec1b47ab1753104749f9
parent39e7905fe16e7c262651a1eefae9dbfa7a3fca37
Tests and docs for registering custom ONNX operators (#2416)

* Add tests, examples and documentation changes for custom ONNX operators registration mechanism

* Change snippet paths

* fix CoreThreadingTests.ReadNetwork - data race in ops_bridge

* Make TemplateExtension::Operation externally visible

* changes after review

* apply code format

* use std::int64_t

* forward declare get_attribute_value specializations

* introduce unregister_operator in onnx_importer

* onnx_custom_op - lock mem first then take a buffer

* func tests - create template_extension via make_so_pointer

* fix build with NGRAPH_ONNX_IMPORT_ENABLE=OFF

* remove exports from Operation and Extension

* Move multithreaded AddExtension test to different directory to it can be excluded when NGRAPH_ONNX_IMPORT_ENABLE=OFF

* Dont include Extension tests if ENABLE_MKL_DNN=OFF

* fix excluding onnx_reader tests

* include extension tests only if mkl is enabled

* add comment on empty blob

* use register_operator conditionally in template_extension

* fix docs after review

* create static library from onnx_custom_op

* add additional test for unregister_operator

* move model example after register step

* revert changes to unit tests

* update ngraphConfig.cmake.in header

* add headers to onnx_custom_op

* changes to docs CMakeLists

* remove redundant onnx_importer dependency

* remove extension directory from func tests

* make onnx_importer a component of ngraph package

* docs fixes

* update header of ngraph/cmake/share/ngraphConfig.cmake.in with ngraph_onnx_importer_FOUND
25 files changed:
docs/CMakeLists.txt
docs/IE_DG/Extensibility_DG/Building.md
docs/IE_DG/Extensibility_DG/Custom_ONNX_Ops.md [new file with mode: 0644]
docs/IE_DG/Extensibility_DG/Extension.md
docs/doxygen/ie_docs.xml
docs/onnx_custom_op/CMakeLists.txt [new file with mode: 0644]
docs/onnx_custom_op/onnx_custom_op.cpp [new file with mode: 0644]
docs/onnx_custom_op/onnx_custom_op.hpp [new file with mode: 0644]
docs/template_extension/CMakeLists.txt
docs/template_extension/extension.cpp
docs/template_extension/extension.hpp
inference-engine/cmake/add_ie_target.cmake
inference-engine/tests/functional/inference_engine/CMakeLists.txt
inference-engine/tests/functional/inference_engine/extension.cpp [new file with mode: 0644]
inference-engine/tests/ie_test_utils/common_test_utils/CMakeLists.txt
ngraph/CMakeLists.txt
ngraph/cmake/share/ngraphConfig.cmake.in
ngraph/core/CMakeLists.txt
ngraph/frontend/onnx_import/CMakeLists.txt
ngraph/frontend/onnx_import/include/onnx_import/core/node.hpp
ngraph/frontend/onnx_import/include/onnx_import/onnx_utils.hpp
ngraph/frontend/onnx_import/include/onnx_import/ops_bridge.hpp
ngraph/frontend/onnx_import/src/onnx_utils.cpp
ngraph/frontend/onnx_import/src/ops_bridge.cpp
ngraph/test/onnx/onnx_import.in.cpp