From f051ce16eee13b7c21a6fbb6746d0487a70bc81c Mon Sep 17 00:00:00 2001 From: Anastasia Kuporosova Date: Tue, 28 Jan 2025 14:19:22 +0000 Subject: [PATCH] update extensions --- docs/articles_en/assets/snippets/ov_custom_op.py | 2 +- docs/articles_en/assets/snippets/ov_extensions.py | 7 ++++++- docs/articles_en/documentation/openvino-extensibility.rst | 4 ---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/articles_en/assets/snippets/ov_custom_op.py b/docs/articles_en/assets/snippets/ov_custom_op.py index 37fc7b34b178a8..9d8bdd7ce10bae 100644 --- a/docs/articles_en/assets/snippets/ov_custom_op.py +++ b/docs/articles_en/assets/snippets/ov_custom_op.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2024 Intel Corporation +# Copyright (C) 2018-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # diff --git a/docs/articles_en/assets/snippets/ov_extensions.py b/docs/articles_en/assets/snippets/ov_extensions.py index 65080775cfb8e4..141fcb912f9bf2 100644 --- a/docs/articles_en/assets/snippets/ov_extensions.py +++ b/docs/articles_en/assets/snippets/ov_extensions.py @@ -21,7 +21,12 @@ #! [add_extension] #! [add_frontend_extension] -# Not implemented +# Register more sophisticated mapping with decomposition +def conversion(node): + input_node = node.get_input(0) + return Identity(input_node).outputs() + +core.add_extension(ConversionExtension("Identity", conversion)) #! [add_frontend_extension] from utils import get_path_to_extension_library diff --git a/docs/articles_en/documentation/openvino-extensibility.rst b/docs/articles_en/documentation/openvino-extensibility.rst index 16abe01c1a021e..3af083ad25787d 100644 --- a/docs/articles_en/documentation/openvino-extensibility.rst +++ b/docs/articles_en/documentation/openvino-extensibility.rst @@ -112,10 +112,6 @@ The ``Identity`` is a custom operation class defined in :doc:`Custom Operation G :language: cpp :fragment: [add_frontend_extension] -The Python API now supports implementation of custom OpenVINO operations, enabling direct integration within Python code. Still python custom operations won't be loaded into the runtime, so use the C++ shared library approach to implement both operation semantics and framework mapping that refers to this custom operation. - -Python can still be used to map and decompose operations when operations from the standard OpenVINO operation set and custom operation implemented in Python are used. - .. _create_a_library_with_extensions: Create a Library with Extensions