diff --git a/.ci/azure/linux.yml b/.ci/azure/linux.yml
index d48aa25f5bb..90c9aa11d17 100644
--- a/.ci/azure/linux.yml
+++ b/.ci/azure/linux.yml
@@ -241,7 +241,7 @@ jobs:
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_DIR)/tests/mo/unit_tests --junitxml=TEST-ModelOptimizer.xml
displayName: 'Model Optimizer UT'
continueOnError: false
- enabled: false
+ enabled: true
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ov_core_unit_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
workingDirectory: $(INSTALL_TEST_DIR)
@@ -334,7 +334,7 @@ jobs:
displayName: 'Samples Smoke Tests'
continueOnError: false
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
- enabled: false
+ enabled: true
- script: |
export DATA_PATH=$(MODELS_PATH)
@@ -353,7 +353,7 @@ jobs:
workingDirectory: $(LAYER_TESTS_DIR)
displayName: 'Layer Tests'
continueOnError: false
- enabled: false
+ enabled: true
- task: PublishTestResults@2
condition: always()
diff --git a/.ci/azure/linux_lohika.yml b/.ci/azure/linux_lohika.yml
index 3e04658ebd6..198e24433c9 100644
--- a/.ci/azure/linux_lohika.yml
+++ b/.ci/azure/linux_lohika.yml
@@ -35,7 +35,7 @@ jobs:
- checkout: none
- - script: git -C ~/work/openvino checkout -m --recurse-submodules $(Build.SourceVersion)
+ - script: git -C ~/work/openvino checkout -m $(Build.SourceVersion) && git -C ~/work/openvino submodule update --init --recursive
displayName: checkout
# Should be after 'Install dependencies' because Git lfs is not installed
@@ -71,7 +71,7 @@ jobs:
./buildreleasenolto.sh
libinference_engine_preproc.so
MKLDNNPlugin
- clDNNPlugin
+ ov_intel_gpu_plugin
clDNN_unit_tests64
gpuFuncTests
displayName: Build Lin
diff --git a/.ci/azure/windows.yml b/.ci/azure/windows.yml
index b9738b6a7bb..81e2b47a622 100644
--- a/.ci/azure/windows.yml
+++ b/.ci/azure/windows.yml
@@ -83,7 +83,7 @@ jobs:
displayName: 'Make dir'
- script: |
- certutil -urlcache -split -f https://openvinoweb.z5.web.core.windows.net/incredibuild/install_ib_console.bat install_ib_console.bat
+ curl -O https://openvinoweb.z5.web.core.windows.net/incredibuild/install_ib_console.bat
call install_ib_console.bat
workingDirectory: $(WORK_DIR)
displayName: 'Install IncrediBuild'
@@ -117,9 +117,9 @@ jobs:
python -m pip install -r $(REPO_DIR)\tools\mo\requirements.txt
python -m pip install -r $(REPO_DIR)\tools\mo\requirements_dev.txt
rem Speed up build
- certutil -urlcache -split -f https://github.com/Kitware/CMake/releases/download/v$(CMAKE_VERSION)/cmake-$(CMAKE_VERSION)-windows-x86_64.zip cmake-$(CMAKE_VERSION)-windows-x86_64.zip
+ powershell -command "Invoke-WebRequest https://github.com/Kitware/CMake/releases/download/v$(CMAKE_VERSION)/cmake-$(CMAKE_VERSION)-windows-x86_64.zip -OutFile cmake-$(CMAKE_VERSION)-windows-x86_64.zip"
powershell -command "Expand-Archive -Force cmake-$(CMAKE_VERSION)-windows-x86_64.zip"
- certutil -urlcache -split -f https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip ninja-win.zip
+ powershell -command "Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip -OutFile ninja-win.zip"
powershell -command "Expand-Archive -Force ninja-win.zip"
git clone https://github.com/google/gtest-parallel.git
workingDirectory: $(WORK_DIR)
diff --git a/.ci/azure/windows_conditional_compilation.yml b/.ci/azure/windows_conditional_compilation.yml
index cc310068d11..3f1e152a4d6 100644
--- a/.ci/azure/windows_conditional_compilation.yml
+++ b/.ci/azure/windows_conditional_compilation.yml
@@ -59,7 +59,7 @@ jobs:
- script: |
rem Speed up build
- certutil -urlcache -split -f https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip ninja-win.zip
+ powershell -command "Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip -OutFile ninja-win.zip"
powershell -command "Expand-Archive -Force ninja-win.zip"
workingDirectory: $(WORK_DIR)
displayName: 'Install dependencies'
diff --git a/CODEOWNERS b/CODEOWNERS
index 8062389595d..34388f4086c 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -35,7 +35,7 @@ Jenkinsfile @openvinotoolkit/openvino-admins
/src/common/ @openvinotoolkit/openvino-ie-maintainers
/src/core/ @openvinotoolkit/openvino-ngraph-maintainers
/src/frontends/ @openvinotoolkit/openvino-ngraph-maintainers
-/inference-engine/tests_deprecated/readers/ @openvinotoolkit/openvino-ngraph-maintainers
+/src/tests_deprecated/readers/ @openvinotoolkit/openvino-ngraph-maintainers
# IE CPU:
/inference-engine/src/mkldnn_plugin/ @openvinotoolkit/openvino-ie-cpu-maintainers @openvinotoolkit/openvino-ie-cpu-developers
@@ -53,12 +53,12 @@ Jenkinsfile @openvinotoolkit/openvino-admins
/inference-engine/src/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers
/src/inference/include/ie/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers
/inference-engine/thirdparty/movidius/ @openvinotoolkit/openvino-ie-vpu-maintainers
-/inference-engine/tests_deprecated/unit/engines/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
-/inference-engine/tests_deprecated/functional/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
-/inference-engine/tests_deprecated/behavior/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
-/inference-engine/tests/functional/plugin/myriad/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
-/inference-engine/tests/unit/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
-/inference-engine/tests/unit/engines/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
+/src/tests_deprecated/unit/engines/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
+/src/tests_deprecated/functional/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
+/src/tests_deprecated/behavior/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
+/src/tests/functional/plugin/myriad/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
+/src/tests/unit/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
+/src/tests/unit/engines/vpu/ @openvinotoolkit/openvino-ie-vpu-maintainers @openvinotoolkit/openvino-ie-tests-maintainers
/inference-engine/scripts/run_tests_myriad_multistick.sh @openvinotoolkit/openvino-ie-vpu-maintainers
# IE GNA:
@@ -70,10 +70,10 @@ Jenkinsfile @openvinotoolkit/openvino-admins
/src/inference/include/ie/multi-device/ @openvinotoolkit/openvino-ie-multi-maintainers
# IE Tests:
-/inference-engine/tests/ @openvinotoolkit/openvino-ie-tests-maintainers
-/inference-engine/tests_deprecated/ @openvinotoolkit/openvino-ie-tests-maintainers
-/inference-engine/tests/functional/inference_engine/ngraph_reader/ @openvinotoolkit/openvino-ie-tests-maintainers @openvinotoolkit/openvino-ngraph-maintainers
-/inference-engine/tests/functional/inference_engine/transformations/ @openvinotoolkit/openvino-ie-tests-maintainers @openvinotoolkit/openvino-ngraph-maintainers
+/src/tests/ @openvinotoolkit/openvino-ie-tests-maintainers
+/src/tests_deprecated/ @openvinotoolkit/openvino-ie-tests-maintainers
+/src/tests/functional/inference_engine/ngraph_reader/ @openvinotoolkit/openvino-ie-tests-maintainers @openvinotoolkit/openvino-ngraph-maintainers
+/src/tests/functional/inference_engine/transformations/ @openvinotoolkit/openvino-ie-tests-maintainers @openvinotoolkit/openvino-ngraph-maintainers
# Documentation:
/docs/ @openvinotoolkit/openvino-docs-maintainers
diff --git a/cmake/developer_package/api_validator/api_validator.cmake b/cmake/developer_package/api_validator/api_validator.cmake
index d58ba745742..2d707dd6a46 100644
--- a/cmake/developer_package/api_validator/api_validator.cmake
+++ b/cmake/developer_package/api_validator/api_validator.cmake
@@ -79,8 +79,20 @@ function(_ie_add_api_validator_post_build_step)
_ie_add_api_validator_post_build_step_recursive(TARGET ${API_VALIDATOR_TARGET})
# remove targets which were tested before
-
- foreach(item IN LISTS VALIDATED_LIBRARIES)
+ foreach(target IN LISTS API_VALIDATOR_TARGETS)
+ list(FIND VALIDATED_LIBRARIES ${target} index)
+ if (NOT index EQUAL -1)
+ list(APPEND VALIDATED_TARGETS ${target})
+ endif()
+ if(TARGET "${target}")
+ get_target_property(orig_target ${target} ALIASED_TARGET)
+ list(FIND VALIDATED_LIBRARIES ${orig_target} index)
+ if (NOT index EQUAL -1)
+ list(APPEND VALIDATED_TARGETS ${target})
+ endif()
+ endif()
+ endforeach()
+ foreach(item IN LISTS VALIDATED_TARGETS)
list(REMOVE_ITEM API_VALIDATOR_TARGETS ${item})
endforeach()
diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake
index b36db7b0d78..b5b07559bea 100644
--- a/cmake/developer_package/frontends/frontends.cmake
+++ b/cmake/developer_package/frontends/frontends.cmake
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
#
-set(FRONTEND_INSTALL_INCLUDE "runtime/include/ngraph/frontend")
+set(FRONTEND_INSTALL_INCLUDE "runtime/include/")
set(FRONTEND_NAME_SUFFIX "_ov_frontend")
set(FRONTEND_NAMES "" CACHE INTERNAL "")
@@ -225,7 +225,7 @@ macro(ov_add_frontend)
if(OV_FRONTEND_LINKABLE_FRONTEND)
# install -dev part
- install(DIRECTORY ${${TARGET_NAME}_INCLUDE_DIR}/${OV_FRONTEND_NAME}_frontend
+ install(DIRECTORY ${${TARGET_NAME}_INCLUDE_DIR}/
DESTINATION ${FRONTEND_INSTALL_INCLUDE}
COMPONENT core_dev
FILES_MATCHING PATTERN "*.hpp")
diff --git a/cmake/developer_package/frontends/ov_frontends.hpp.in b/cmake/developer_package/frontends/ov_frontends.hpp.in
index 0293054160d..82c1f1d010f 100644
--- a/cmake/developer_package/frontends/ov_frontends.hpp.in
+++ b/cmake/developer_package/frontends/ov_frontends.hpp.in
@@ -4,7 +4,7 @@
#pragma once
-#include "common/frontend.hpp"
+#include "openvino/frontend/frontend.hpp"
@OV_FRONTEND_DECLARATIONS@
diff --git a/cmake/test_model_zoo.cmake b/cmake/test_model_zoo.cmake
index 63446532639..de29223baa7 100644
--- a/cmake/test_model_zoo.cmake
+++ b/cmake/test_model_zoo.cmake
@@ -66,22 +66,22 @@ ov_model_convert("${CMAKE_CURRENT_SOURCE_DIR}/src/core/tests"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/core"
onnx_out_files)
-set(rel_path "inference-engine/tests/functional/plugin/shared/models")
+set(rel_path "src/tests/functional/plugin/shared/models")
ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/func_tests/models"
ft_out_files)
-set(rel_path "inference-engine/tests/functional/inference_engine/onnx_reader")
+set(rel_path "src/tests/functional/inference_engine/onnx_reader")
ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/onnx_reader"
ie_onnx_out_files)
-set(rel_path "inference-engine/tests/functional/inference_engine/ir_serialization")
+set(rel_path "src/tests/functional/inference_engine/ir_serialization")
ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/ir_serialization"
ie_serialize_out_files)
-set(rel_path "inference-engine/tests/unit/frontends/onnx_import/models")
+set(rel_path "src/tests/unit/frontends/onnx_import/models")
ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/onnx_import"
ie_onnx_import_out_files)
diff --git a/docs/HOWTO/mo_extensions/front/tf/Complex.py b/docs/HOWTO/mo_extensions/front/tf/Complex.py
index fa23d9b1f4d..60167aad6c0 100644
--- a/docs/HOWTO/mo_extensions/front/tf/Complex.py
+++ b/docs/HOWTO/mo_extensions/front/tf/Complex.py
@@ -2,12 +2,9 @@
# SPDX-License-Identifier: Apache-2.0
#! [complex:transformation]
-import logging as log
-import numpy as np
-
-from mo.front.common.replacement import FrontReplacementSubgraph
-from mo.graph.graph import Graph
+from openvino.tools.mo.front.common.replacement import FrontReplacementSubgraph
+from openvino.tools.mo.graph.graph import Graph
class Complex(FrontReplacementSubgraph):
@@ -41,4 +38,3 @@ class Complex(FrontReplacementSubgraph):
# change the connection so now all consumers of "complex_node" get data from input node of strided slice nodes
complex_node.out_port(0).get_connection().set_source(input_node_output_port)
#! [complex:transformation]
-
diff --git a/docs/HOWTO/mo_extensions/front/tf/ComplexAbs.py b/docs/HOWTO/mo_extensions/front/tf/ComplexAbs.py
index 4fe0368fd66..ea6c94ed1e2 100644
--- a/docs/HOWTO/mo_extensions/front/tf/ComplexAbs.py
+++ b/docs/HOWTO/mo_extensions/front/tf/ComplexAbs.py
@@ -4,11 +4,11 @@
#! [complex_abs:transformation]
import numpy as np
-from extensions.ops.elementwise import Pow
-from extensions.ops.ReduceOps import ReduceSum
-from mo.front.common.replacement import FrontReplacementOp
-from mo.graph.graph import Graph, Node
-from mo.ops.const import Const
+from openvino.tools.mo.ops.elementwise import Pow
+from openvino.tools.mo.ops.ReduceOps import ReduceSum
+from openvino.tools.mo.front.common.replacement import FrontReplacementOp
+from openvino.tools.mo.graph.graph import Graph, Node
+from openvino.tools.mo.ops.const import Const
class ComplexAbs(FrontReplacementOp):
diff --git a/docs/HOWTO/mo_extensions/front/tf/FFT_ext.py b/docs/HOWTO/mo_extensions/front/tf/FFT_ext.py
index e5216d2ea3e..c15c4e38903 100644
--- a/docs/HOWTO/mo_extensions/front/tf/FFT_ext.py
+++ b/docs/HOWTO/mo_extensions/front/tf/FFT_ext.py
@@ -3,8 +3,7 @@
# ! [fft_ext:extractor]
from ...ops.FFT import FFT
-from mo.front.extractor import FrontExtractorOp
-from mo.utils.error import Error
+from openvino.tools.mo.front.extractor import FrontExtractorOp
class FFT2DFrontExtractor(FrontExtractorOp):
diff --git a/docs/HOWTO/mo_extensions/ops/FFT.py b/docs/HOWTO/mo_extensions/ops/FFT.py
index 92645cd6967..e0f018fa165 100644
--- a/docs/HOWTO/mo_extensions/ops/FFT.py
+++ b/docs/HOWTO/mo_extensions/ops/FFT.py
@@ -2,9 +2,9 @@
# SPDX-License-Identifier: Apache-2.0
#! [fft:operation]
-from mo.front.common.partial_infer.elemental import copy_shape_infer
-from mo.graph.graph import Node, Graph
-from mo.ops.op import Op
+from openvino.tools.mo.front.common.partial_infer.elemental import copy_shape_infer
+from openvino.tools.mo.graph.graph import Graph
+from openvino.tools.mo.ops.op import Op
class FFT(Op):
diff --git a/docs/IE_PLUGIN_DG/Doxyfile b/docs/IE_PLUGIN_DG/Doxyfile
index a9367a25888..7d7735b1fbc 100644
--- a/docs/IE_PLUGIN_DG/Doxyfile
+++ b/docs/IE_PLUGIN_DG/Doxyfile
@@ -868,7 +868,7 @@ EXAMPLE_PATH = ../template_plugin/src \
../template_plugin/tests/functional/CMakeLists.txt \
../template_plugin/tests/functional/transformations \
../template_plugin/tests/functional/shared_tests_instances/ \
- ../../inference-engine/tests/functional/plugin/shared/include \
+ ../../src/tests/functional/plugin/shared/include \
../snippets
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
diff --git a/docs/MO_DG/prepare_model/convert_model/Converting_Model_General.md b/docs/MO_DG/prepare_model/convert_model/Converting_Model_General.md
index 2e708e1eaa1..07f8886a0e9 100644
--- a/docs/MO_DG/prepare_model/convert_model/Converting_Model_General.md
+++ b/docs/MO_DG/prepare_model/convert_model/Converting_Model_General.md
@@ -59,11 +59,14 @@ Framework-agnostic parameters:
--reverse_input_channels
Switch the input channels order from RGB to BGR (or
vice versa). Applied to original inputs of the model
- if and only if a number of channels equals 3. Applied
- after application of --mean_values and --scale_values
- options, so numbers in --mean_values and
- --scale_values go in the order of channels used in the
- original model.
+ if and only if a number of channels equals 3.
+ When --mean_values/--scale_values are also specified,
+ reversing of channels will be applied to user's input
+ data first, so that numbers in --mean_values and
+ --scale_values go in the order of channels used in
+ the original model. In other words, if both options are
+ specified then the data flow in the model looks as following:
+ Parameter -> ReverseInputChannels -> Mean/Scale apply -> the original body of the model.
--log_level {CRITICAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}
Logger level
--input INPUT Quoted list of comma-separated input nodes names with
diff --git a/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md b/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md
index d133654b8df..d29b2edeb6c 100644
--- a/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md
+++ b/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md
@@ -639,9 +639,9 @@ graph. Consider the extractor for the TensorFlow\* operation `Const` (refer to t
`extensions/front/tf/const_ext.py`):
```py
-from mo.front.extractor import FrontExtractorOp
-from mo.front.tf.extractors.utils import tf_dtype_extractor, tf_tensor_shape, tf_tensor_content
-from mo.ops.const import Const
+from openvino.tools.mo.front.extractor import FrontExtractorOp
+from openvino.tools.mo.front.tf.extractors.utils import tf_dtype_extractor, tf_tensor_shape, tf_tensor_content
+from openvino.tools.mo.ops.const import Const
class ConstExtractor(FrontExtractorOp):
@@ -679,9 +679,9 @@ Consider another example with an extractor of ONNX\* operation `Constant` (refer
from onnx import numpy_helper
from onnx.numpy_helper import to_array
-from mo.front.extractor import FrontExtractorOp
-from mo.front.onnx.extractors.utils import onnx_attr
-from mo.ops.const import Const
+from openvino.tools.mo.front.extractor import FrontExtractorOp
+from openvino.tools.mo.front.onnx.extractors.utils import onnx_attr
+from openvino.tools.mo.ops.const import Const
class ConstantExtractor(FrontExtractorOp):
@@ -814,11 +814,11 @@ fusing of the sub-graph defining the [Mish](../../../ops/activation/Mish_4.md) a
operation:
```py
-from extensions.front.Softplus_fusion import SoftplusFusion
-from extensions.ops.activation_ops import Mish
-from mo.front.common.replacement import FrontReplacementSubgraph
-from mo.front.subgraph_matcher import SubgraphMatch
-from mo.graph.graph import Graph, rename_nodes
+from openvino.tools.mo.front.Softplus_fusion import SoftplusFusion
+from openvino.tools.mo.ops.activation_ops import Mish
+from openvino.tools.mo.front.common.replacement import FrontReplacementSubgraph
+from openvino.tools.mo.front.subgraph_matcher import SubgraphMatch
+from openvino.tools.mo.graph.graph import Graph, rename_nodes
class MishFusion(FrontReplacementSubgraph):
@@ -886,12 +886,12 @@ transformation.
Consider an example transformation from the file is `extensions/front/Pack.py` which replaces operation `Pack` from
the TensorFlow\*:
```py
-from mo.front.common.partial_infer.utils import int64_array
-from mo.front.common.replacement import FrontReplacementOp
-from mo.front.tf.graph_utils import create_op_with_const_inputs
-from mo.graph.graph import Node, Graph, rename_nodes
-from mo.ops.concat import Concat
-from mo.ops.unsqueeze import Unsqueeze
+from openvino.tools.mo.front.common.partial_infer.utils import int64_array
+from openvino.tools.mo.front.common.replacement import FrontReplacementOp
+from openvino.tools.mo.front.tf.graph_utils import create_op_with_const_inputs
+from openvino.tools.mo.graph.graph import Node, Graph, rename_nodes
+from openvino.tools.mo.ops.concat import Concat
+from openvino.tools.mo.ops.unsqueeze import Unsqueeze
class Pack(FrontReplacementOp):
@@ -932,11 +932,11 @@ specification.
```py
import logging as log
-from mo.front.common.partial_infer.utils import int64_array
-from mo.front.common.replacement import FrontReplacementPattern
-from mo.graph.graph import Graph
-from mo.ops.const import Const
-from mo.utils.error import Error
+from openvino.tools.mo.front.common.partial_infer.utils import int64_array
+from openvino.tools.mo.front.common.replacement import FrontReplacementPattern
+from openvino.tools.mo.graph.graph import Graph
+from openvino.tools.mo.ops.const import Const
+from openvino.tools.mo.utils.error import Error
class SqueezeNormalize(FrontReplacementPattern):
@@ -1200,13 +1200,13 @@ The example of the configuration file for this type of transformation is `extens
and the corresponding transformation file is `./extensions/front/YOLO.py`:
```py
-from extensions.front.no_op_eraser import NoOpEraser
-from extensions.front.standalone_const_eraser import StandaloneConstEraser
-from extensions.ops.regionyolo import RegionYoloOp
-from mo.front.tf.replacement import FrontReplacementFromConfigFileGeneral
-from mo.graph.graph import Node, Graph
-from mo.ops.result import Result
-from mo.utils.error import Error
+from openvino.tools.mo.front.no_op_eraser import NoOpEraser
+from openvino.tools.mo.front.standalone_const_eraser import StandaloneConstEraser
+from openvino.tools.mo.ops.regionyolo import RegionYoloOp
+from openvino.tools.mo.front.tf.replacement import FrontReplacementFromConfigFileGeneral
+from openvino.tools.mo.graph.graph import Node, Graph
+from openvino.tools.mo.ops.result import Result
+from openvino.tools.mo.utils.error import Error
class YoloRegionAddon(FrontReplacementFromConfigFileGeneral):
diff --git a/docs/MO_DG/prepare_model/customize_model_optimizer/Extending_MXNet_Model_Optimizer_with_New_Primitives.md b/docs/MO_DG/prepare_model/customize_model_optimizer/Extending_MXNet_Model_Optimizer_with_New_Primitives.md
index e20a44969cf..9c4774715e4 100644
--- a/docs/MO_DG/prepare_model/customize_model_optimizer/Extending_MXNet_Model_Optimizer_with_New_Primitives.md
+++ b/docs/MO_DG/prepare_model/customize_model_optimizer/Extending_MXNet_Model_Optimizer_with_New_Primitives.md
@@ -20,9 +20,9 @@ assume that we have already created the `CustomOp` class (inherited from `Op` cl
for this MXNet custom operation as described in the [Customize_Model_Optimizer](Customize_Model_Optimizer.md).
```py
-from extension.ops.custom_op import CustomOp # implementation of the MO operation class
-from mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs
-from mo.front.extractor import MXNetCustomFrontExtractorOp
+from openvino.tools.mo.ops.custom_op import CustomOp # implementation of the MO operation class
+from openvino.tools.mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs
+from openvino.tools.mo.front.extractor import MXNetCustomFrontExtractorOp
class CustomProposalFrontExtractor(MXNetCustomFrontExtractorOp): # inherit from specific base class
op = 'MyCustomOp' # the value corresponding to the `op_type` value of the MXNet operation
diff --git a/docs/MO_DG/prepare_model/customize_model_optimizer/Extending_Model_Optimizer_with_Caffe_Python_Layers.md b/docs/MO_DG/prepare_model/customize_model_optimizer/Extending_Model_Optimizer_with_Caffe_Python_Layers.md
index 579437aeb5a..f95fae23e2b 100644
--- a/docs/MO_DG/prepare_model/customize_model_optimizer/Extending_Model_Optimizer_with_Caffe_Python_Layers.md
+++ b/docs/MO_DG/prepare_model/customize_model_optimizer/Extending_Model_Optimizer_with_Caffe_Python_Layers.md
@@ -40,8 +40,8 @@ operation `ProposalOp` which corresponds to `Proposal` operation described in th
document. Refer to the source code below for a detailed explanation of the extractor.
```py
-from extensions.ops.proposal import ProposalOp
-from mo.front.extractor import CaffePythonFrontExtractorOp
+from openvino.tools.mo.ops.proposal import ProposalOp
+from openvino.tools.mo.front.extractor import CaffePythonFrontExtractorOp
class ProposalPythonFrontExtractor(CaffePythonFrontExtractorOp):
diff --git a/docs/nGraph_DG/nGraphTransformation.md b/docs/nGraph_DG/nGraphTransformation.md
index 524dbf59c6e..b27a2876b98 100644
--- a/docs/nGraph_DG/nGraphTransformation.md
+++ b/docs/nGraph_DG/nGraphTransformation.md
@@ -430,7 +430,7 @@ PassConfig instance taken from pass::Manager is shared across all registered tra
## Transformations testing
If you are developing new transformation inside plugin, you need to add test into the `template_plugin/tests/functional/transformations` folder.
-We have two types of tests: nGraph reader tests located in `inference-engine/tests/functional/inference_engine/ngraph_reader` and transformation tests located in `inference-engine/tests/functional/inference_engine/transformations`
+We have two types of tests: nGraph reader tests located in `src/tests/functional/inference_engine/ngraph_reader` and transformation tests located in `src/tests/functional/inference_engine/transformations`
Reader tests are IR based and test end-to-end conversion from IR to CNNNetwork. Transformation tests test single ngraph transformations or low-level functions that are used inside transformations.
The basic transformation test looks like this:
diff --git a/docs/template_plugin/backend/CMakeLists.txt b/docs/template_plugin/backend/CMakeLists.txt
index e075a555099..df959ed86e5 100644
--- a/docs/template_plugin/backend/CMakeLists.txt
+++ b/docs/template_plugin/backend/CMakeLists.txt
@@ -38,17 +38,10 @@ target_include_directories(interpreter_backend PUBLIC $& op, const HostTensorVector& outputs
}
namespace ctc_loss_v4 {
-template
+template ::value_type>::value &&
+ !std::is_same::value_type, bfloat16>::value &&
+ !std::is_same::value_type, float16>::value,
+ bool>::type = true>
+inline void evaluate(const shared_ptr& op,
+ const HostTensorVector& outputs,
+ const HostTensorVector& inputs) {
+ OPENVINO_ASSERT(false, "The data type for logits is expected to be a floating point type. Got:", element::Type(t1));
+}
+
+template ::value_type>::value ||
+ std::is_same::value_type, bfloat16>::value ||
+ std::is_same::value_type, float16>::value,
+ bool>::type = true>
inline void evaluate(const shared_ptr& op,
const HostTensorVector& outputs,
const HostTensorVector& inputs) {
@@ -1944,6 +1961,30 @@ bool evaluate(const shared_ptr& op, const HostTensorVector& out
return true;
}
+template
+bool evaluate(const shared_ptr& op, const HostTensorVector& outputs, const HostTensorVector& inputs) {
+ using T = typename element_type_traits::value_type;
+ runtime::reference::lstm_cell(inputs[0]->get_data_ptr(),
+ inputs[0]->get_shape(),
+ inputs[1]->get_data_ptr(),
+ inputs[1]->get_shape(),
+ inputs[2]->get_data_ptr(),
+ inputs[2]->get_shape(),
+ inputs[3]->get_data_ptr(),
+ inputs[3]->get_shape(),
+ inputs[4]->get_data_ptr(),
+ inputs[4]->get_shape(),
+ inputs[5]->get_data_ptr(),
+ inputs[5]->get_shape(),
+ outputs[0]->get_data_ptr(),
+ outputs[1]->get_data_ptr(),
+ op->get_activations()[0],
+ op->get_activations()[1],
+ op->get_activations()[2],
+ op->get_clip());
+ return true;
+}
+
template
bool evaluate(const shared_ptr& op, const HostTensorVector& outputs, const HostTensorVector& inputs) {
using T = typename element_type_traits::value_type;
diff --git a/docs/template_plugin/backend/opset_int_tbl.hpp b/docs/template_plugin/backend/opset_int_tbl.hpp
index fe1230d79d4..287bf9a0d11 100644
--- a/docs/template_plugin/backend/opset_int_tbl.hpp
+++ b/docs/template_plugin/backend/opset_int_tbl.hpp
@@ -20,6 +20,7 @@ NGRAPH_OP(Gelu, op::v0)
NGRAPH_OP(GRN, op::v0)
NGRAPH_OP(HardSigmoid, op::v0)
NGRAPH_OP(LRN, ngraph::op::v0)
+NGRAPH_OP(LSTMCell, op::v0)
NGRAPH_OP(MVN, ngraph::op::v0)
NGRAPH_OP(NormalizeL2, op::v0)
NGRAPH_OP(PriorBox, ngraph::op::v0)
diff --git a/docs/template_plugin/src/CMakeLists.txt b/docs/template_plugin/src/CMakeLists.txt
index 125ee872d02..18b20731e18 100644
--- a/docs/template_plugin/src/CMakeLists.txt
+++ b/docs/template_plugin/src/CMakeLists.txt
@@ -37,4 +37,3 @@ set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_REL
# ie_register_plugins(MAIN_TARGET ${TARGET_NAME}
# POSSIBLE_PLUGINS ${TARGET_NAME})
# [cmake:plugin]
-ov_install_static_lib(interpreter_backend tests)
diff --git a/docs/template_plugin/tests/functional/op_reference/einsum.cpp b/docs/template_plugin/tests/functional/op_reference/einsum.cpp
new file mode 100644
index 00000000000..625521dc42b
--- /dev/null
+++ b/docs/template_plugin/tests/functional/op_reference/einsum.cpp
@@ -0,0 +1,182 @@
+// Copyright (C) 2021 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include
+
+#include "openvino/opsets/opset7.hpp"
+#include "openvino/opsets/opset1.hpp"
+#include "base_reference_test.hpp"
+
+using namespace reference_tests;
+using namespace ov;
+
+namespace {
+struct EinsumParams {
+ std::vector inputs;
+ std::string equation;
+ Tensor expectedResult;
+ std::string testcaseName;
+};
+
+struct Builder : ParamsBuilder {
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, inputs);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, equation);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, expectedResult);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, testcaseName);
+};
+
+class ReferenceEinsumTest : public testing::TestWithParam, public CommonReferenceTest {
+public:
+ void SetUp() override {
+ auto params = GetParam();
+ function = CreateModel(params);
+ for (const auto& input_tensor : params.inputs) {
+ inputData.push_back(input_tensor.data);
+ }
+ refOutData = {params.expectedResult.data};
+ }
+
+ static std::string getTestCaseName(const testing::TestParamInfo& obj) {
+ auto param = obj.param;
+ std::ostringstream result;
+ result << "iType=" << param.inputs[0].type;
+ result << "_iShape=" << param.inputs[0].shape;
+ result << "_equation=" << param.equation;
+ result << "_eType=" << param.expectedResult.type;
+ result << "_eShape=" << param.expectedResult.shape;
+ if (param.testcaseName != "") {
+ result << "_=" << param.testcaseName;
+ }
+ return result.str();
+ }
+
+private:
+ static std::shared_ptr CreateModel(const EinsumParams& params) {
+ OutputVector output_vector;
+ ParameterVector param_vector;
+ for (const auto& input_tensor : params.inputs) {
+ auto param = std::make_shared(input_tensor.type, input_tensor.shape);
+ output_vector.push_back(param);
+ param_vector.push_back(param);
+ }
+ const auto einsum = std::make_shared(output_vector, params.equation);
+ const auto f = std::make_shared(OutputVector{einsum}, param_vector);
+ return f;
+ }
+};
+
+TEST_P(ReferenceEinsumTest, CompareWithRefs) {
+ Exec();
+}
+
+template
+std::vector generateParams() {
+ using T = typename element_type_traits::value_type;
+ std::vector params {
+ Builder {}
+ .inputs({{ET, {1, 2}, std::vector{1, 2}},
+ {ET, {3, 4}, std::vector{3, 4, 5, 6,
+ 7, 8, 9, 10,
+ 11, 12, 13, 14}}})
+ .equation("ab,cd->abcd")
+ .expectedResult({ET, {1, 2, 3, 4}, std::vector{3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 6, 8, 10, 12,
+ 14, 16, 18, 20, 22, 24, 26, 28}})
+ .testcaseName("einsum_no_reduction"),
+ Builder {}
+ .inputs({{ET, {1, 2, 3}, std::vector{1, 2, 3, 4, 5, 6}}})
+ .equation("ijk->kij")
+ .expectedResult({ET, {3, 1, 2}, std::vector{1, 4, 2, 5, 3, 6}})
+ .testcaseName("einsum_transpose"),
+
+ Builder {}
+ .inputs({{ET, {2, 3}, std::vector{1, 2, 3, 4, 5, 6}}})
+ .equation("ab->a")
+ .expectedResult({ET, {2}, std::vector{6, 15}})
+ .testcaseName("einsum_reduce"),
+
+ Builder {}
+ .inputs({{ET, {2, 3}, std::vector{1, 2, 3, 4, 5, 6}},
+ {ET, {3, 2}, std::vector{1, 2, 3, 4, 5, 6}}})
+ .equation("ab,bc->ac")
+ .expectedResult({ET, {2, 2}, std::vector{22, 28, 49, 64}})
+ .testcaseName("einsum_matrix_multiplication"),
+
+ Builder {}
+ .inputs({{ET, {2, 4}, std::vector{1, 3, 2, 7, 5, 6, 0, 1}},
+ {ET, {4, 3, 1}, std::vector{1, 2, 3, 4, 5, 6, 5, 7, 3, 7, 9, 1}},
+ {ET, {4, 3}, std::vector{4, 3, 1, 6, 4, 2, 2, 5, 3, 1, 9, 4}}})
+ .equation("ab,bcd,bc->ca")
+ .expectedResult({ET, {3, 2}, std::vector{145, 171, 703, 231, 85, 91}})
+ .testcaseName("einsum_multiple_multiplication"),
+
+ Builder {}
+ .inputs({{ET, {2, 2, 3}, std::vector{1, 3, 2, 7, 5, 6, 3, 5, 2, 1, 0, 7}}})
+ .equation("a...->...")
+ .expectedResult({ET, {2, 3}, std::vector{4, 8, 4, 8, 5, 13}})
+ .testcaseName("einsum_ellipsis_one_input_reduction"),
+
+ Builder {}
+ .inputs({{ET, {2, 2, 3}, std::vector{1, 3, 2, 7, 5, 6, 3, 5, 2, 1, 0, 7}}})
+ .equation("a...->...a")
+ .expectedResult({ET, {2, 3, 2}, std::vector{1, 3, 3, 5, 2, 2, 7, 1, 5, 0, 6, 7}})
+ .testcaseName("einsum_ellipsis_one_input_transpose"),
+
+ Builder {}
+ .inputs({{ET, {2, 2, 3}, std::vector{1, 3, 2, 7, 5, 6, 3, 5, 2, 1, 0, 7}},
+ {ET, {1}, std::vector{2}}})
+ .equation("ab...,...->ab...")
+ .expectedResult({ET, {2, 2, 3}, std::vector{2, 6, 4, 14, 10, 12, 6, 10, 4, 2, 0, 14}})
+ .testcaseName("einsum_ellipsis_mul_by_1dscalar"),
+
+ Builder {}
+ .inputs({{ET, {1, 1, 4, 3}, std::vector{1, 3, 2, 7, 5, 6, 3, 5, 2, 1, 0, 7}},
+ {ET, {3, 4, 2, 1}, std::vector{3, 1, 6, 2, 3, 10, 9, 8, 2, 9, 3, 2,
+ 4, 2, 3, 1, 9, 1, 11, 4, 7, 2, 3, 1}}})
+ .equation("a...j,j...->a...")
+ .expectedResult({ET, {1, 4, 2, 4}, std::vector{27, 85, 37, 66, 30, 58, 50, 8,
+ 37, 123, 55, 83, 16, 48, 24, 30,
+ 29, 83, 43, 52, 20, 92, 44, 24,
+ 24, 96, 48, 30, 13, 67, 31, 15}})
+ .testcaseName("einsum_ellipsis_complex_mul"),
+
+ Builder {}
+ .inputs({{ET, {1, 3, 3}, std::vector{1, 2, 3, 4, 5, 6, 7, 8, 9}}})
+ .equation("kii->ki")
+ .expectedResult({ET, {1, 3}, std::vector{1, 5, 9}})
+ .testcaseName("einsum_diagonal"),
+
+ Builder {}
+ .inputs({{ET, {2, 3, 3, 2, 4}, std::vector{4, 2, 5, 4, 5, 5, 1, 1, 3, 3, 1, 1, 2, 2, 4, 1, 3, 4,
+ 4, 5, 1, 3, 1, 3, 1, 4, 3, 5, 4, 4, 5, 4, 4, 5, 4, 2,
+ 2, 2, 3, 3, 1, 1, 4, 3, 4, 2, 2, 1, 1, 2, 3, 1, 1, 4,
+ 2, 3, 1, 3, 4, 2, 5, 5, 3, 4, 3, 4, 5, 4, 4, 5, 1, 3,
+ 4, 4, 5, 3, 1, 3, 2, 5, 3, 2, 5, 4, 4, 2, 4, 4, 1, 4,
+ 4, 5, 4, 4, 4, 2, 3, 3, 4, 2, 4, 2, 5, 1, 3, 2, 4, 3,
+ 5, 1, 2, 3, 1, 1, 2, 5, 1, 1, 2, 1, 4, 5, 3, 4, 1, 3,
+ 3, 1, 3, 2, 4, 5, 1, 1, 5, 4, 5, 2, 2, 3, 3, 1, 2, 4}},
+ {ET, {3, 2, 1}, std::vector{1, 4, 4, 5, 3, 3}}})
+ .equation("abbac,bad->ad")
+ .expectedResult({ET, {2, 1}, std::vector{123, 129}})
+ .testcaseName("einsum_diagonal_with_matmul"),
+ };
+ return params;
+}
+
+std::vector generateCombinedParams() {
+ const std::vector> generatedParams {
+ generateParams(),
+ generateParams(),
+ };
+ std::vector combinedParams;
+
+ for (const auto& params : generatedParams) {
+ combinedParams.insert(combinedParams.end(), params.begin(), params.end());
+ }
+ return combinedParams;
+}
+
+INSTANTIATE_TEST_SUITE_P(smoke_Einsum_With_Hardcoded_Refs, ReferenceEinsumTest,
+ testing::ValuesIn(generateCombinedParams()), ReferenceEinsumTest::getTestCaseName);
+} // namespace
diff --git a/docs/template_plugin/tests/functional/op_reference/extract_image_patches.cpp b/docs/template_plugin/tests/functional/op_reference/extract_image_patches.cpp
new file mode 100644
index 00000000000..503880ce8ac
--- /dev/null
+++ b/docs/template_plugin/tests/functional/op_reference/extract_image_patches.cpp
@@ -0,0 +1,246 @@
+// Copyright (C) 2021 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include
+
+#include "openvino/opsets/opset3.hpp"
+#include "openvino/opsets/opset1.hpp"
+#include "base_reference_test.hpp"
+
+using namespace reference_tests;
+using namespace ov;
+
+namespace {
+struct ExtractImagePatchesParams {
+ Tensor data;
+ Shape sizes;
+ Strides strides;
+ Shape rates;
+ op::PadType autoPad;
+ Tensor expectedResult;
+ std::string testcaseName;
+};
+
+struct Builder : ParamsBuilder {
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, data);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, sizes);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, strides);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, rates);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, autoPad);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, expectedResult);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, testcaseName);
+};
+
+class ReferenceExtractImagePatchesTest : public testing::TestWithParam, public CommonReferenceTest {
+public:
+ void SetUp() override {
+ auto params = GetParam();
+ function = CreateModel(params);
+ inputData = {params.data.data};
+ refOutData = {params.expectedResult.data};
+ }
+
+ static std::string getTestCaseName(const testing::TestParamInfo& obj) {
+ auto param = obj.param;
+ std::ostringstream result;
+ result << "dType=" << param.data.type;
+ result << "_dShape=" << param.data.shape;
+ result << "_sizes=" << param.sizes;
+ result << "_strides=" << param.strides;
+ result << "_rates=" << param.rates;
+ result << "_autoPad=" << param.autoPad;
+ result << "_eType=" << param.expectedResult.type;
+ result << "_eShape=" << param.expectedResult.shape;
+ if (param.testcaseName != "") {
+ result << "_=" << param.testcaseName;
+ }
+ return result.str();
+ }
+
+private:
+ static std::shared_ptr CreateModel(const ExtractImagePatchesParams& params) {
+ const auto data = std::make_shared(params.data.type, params.data.shape);
+ const auto extrace_image_patches = std::make_shared(data,
+ params.sizes,
+ params.strides,
+ params.rates,
+ params.autoPad);
+ const auto f = std::make_shared(extrace_image_patches, ParameterVector{data});
+ return f;
+ }
+};
+
+TEST_P(ReferenceExtractImagePatchesTest, CompareWithRefs) {
+ Exec();
+}
+
+template
+std::vector generateParams() {
+ using T = typename element_type_traits::value_type;
+ std::vector params {
+ Builder {}
+ .data({ET, {1, 1, 10, 10}, std::vector{
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}})
+ .sizes({3, 3})
+ .strides({5, 5})
+ .rates({1, 1})
+ .autoPad(op::PadType::VALID)
+ .expectedResult({ET, {1, 9, 2, 2}, std::vector{
+ 1, 6, 51, 56,
+ 2, 7, 52, 57,
+ 3, 8, 53, 58,
+ 11, 16, 61, 66,
+ 12, 17, 62, 67,
+ 13, 18, 63, 68,
+ 21, 26, 71, 76,
+ 22, 27, 72, 77,
+ 23, 28, 73, 78}}),
+
+ Builder {}
+ .data({ET, {1, 1, 10, 10}, std::vector{
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}})
+ .sizes({4, 4})
+ .strides({8, 8})
+ .rates({1, 1})
+ .autoPad(op::PadType::VALID)
+ .expectedResult({ET, {1, 16, 1, 1}, std::vector{
+ 1, 2, 3, 4,
+ 11, 12, 13, 14,
+ 21, 22, 23, 24,
+ 31, 32, 33, 34}}),
+
+ Builder {}
+ .data({ET, {1, 1, 10, 10}, std::vector{
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}})
+ .sizes({4, 4})
+ .strides({9, 9})
+ .rates({1, 1})
+ .autoPad(op::PadType::SAME_UPPER)
+ .expectedResult({ET, {1, 16, 2, 2}, std::vector{
+ 0, 0, 0, 89,
+ 0, 0, 81, 90,
+ 0, 0, 82, 0,
+ 0, 0, 83, 0,
+ 0, 9, 0, 99,
+ 1, 10, 91, 100,
+ 2, 0, 92, 0,
+ 3, 0, 93, 0,
+ 0, 19, 0, 0,
+ 11, 20, 0, 0,
+ 12, 0, 0, 0,
+ 13, 0, 0, 0,
+ 0, 29, 0, 0,
+ 21, 30, 0, 0,
+ 22, 0, 0, 0,
+ 23, 0, 0, 0}}),
+
+ Builder {}
+ .data({ET, {1, 1, 10, 10}, std::vector{
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}})
+ .sizes({3, 3})
+ .strides({5, 5})
+ .rates({2, 2})
+ .autoPad(op::PadType::VALID)
+ .expectedResult({ET, {1, 9, 2, 2}, std::vector{
+ 1, 6, 51, 56,
+ 3, 8, 53, 58,
+ 5, 10, 55, 60,
+ 21, 26, 71, 76,
+ 23, 28, 73, 78,
+ 25, 30, 75, 80,
+ 41, 46, 91, 96,
+ 43, 48, 93, 98,
+ 45, 50, 95, 100}}),
+
+ Builder {}
+ .data({ET, {1, 2, 5, 5}, std::vector{
+ 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50}})
+ .sizes({2, 2})
+ .strides({3, 3})
+ .rates({1, 1})
+ .autoPad(op::PadType::VALID)
+ .expectedResult({ET, {1, 8, 2, 2}, std::vector{
+ 1, 4, 16, 19,
+ 26, 29, 41, 44,
+ 2, 5, 17, 20,
+ 27, 30, 42, 45,
+ 6, 9, 21, 24,
+ 31, 34, 46, 49,
+ 7, 10, 22, 25,
+ 32, 35, 47, 50}}),
+ };
+ return params;
+}
+
+std::vector generateCombinedParams() {
+ const std::vector> generatedParams {
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ generateParams(),
+ };
+ std::vector combinedParams;
+
+ for (const auto& params : generatedParams) {
+ combinedParams.insert(combinedParams.end(), params.begin(), params.end());
+ }
+ return combinedParams;
+}
+
+INSTANTIATE_TEST_SUITE_P(smoke_ExtractImagePatches_With_Hardcoded_Refs, ReferenceExtractImagePatchesTest,
+ testing::ValuesIn(generateCombinedParams()), ReferenceExtractImagePatchesTest::getTestCaseName);
+} // namespace
diff --git a/docs/template_plugin/tests/functional/op_reference/lstm_cell.cpp b/docs/template_plugin/tests/functional/op_reference/lstm_cell.cpp
index c28bbf0ba94..493224da17b 100644
--- a/docs/template_plugin/tests/functional/op_reference/lstm_cell.cpp
+++ b/docs/template_plugin/tests/functional/op_reference/lstm_cell.cpp
@@ -4,7 +4,8 @@
#include
-#include "openvino/op/lstm_cell.hpp"
+#include "openvino/opsets/opset4.hpp"
+#include "openvino/opsets/opset1.hpp"
#include "base_reference_test.hpp"
using namespace reference_tests;
@@ -12,13 +13,6 @@ using namespace ov;
namespace {
struct LSTMCellParams {
- LSTMCellParams(
- int32_t batchSize, int32_t inputSize, int32_t hiddenSize, int32_t gatesCount,
- const Tensor& X, const Tensor& W, const Tensor& R, const Tensor& H_t, const Tensor& C_t, const Tensor& B,
- const Tensor& Ho, const Tensor& Co, const std::string& testcaseName = "") :
- batchSize(batchSize), inputSize(inputSize), hiddenSize(hiddenSize), gatesCount(gatesCount),
- X(X), W(W), R(R), H_t(H_t), C_t(C_t), B(B), Ho(Ho), Co(Co), testcaseName(testcaseName) {}
-
int32_t batchSize;
int32_t inputSize;
int32_t hiddenSize;
@@ -34,6 +28,22 @@ struct LSTMCellParams {
std::string testcaseName;
};
+struct Builder : ParamsBuilder {
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, batchSize);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, inputSize);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, hiddenSize);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, gatesCount);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, X);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, W);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, R);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, H_t);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, C_t);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, B);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, Ho);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, Co);
+ REFERENCE_TESTS_ADD_SET_PARAM(Builder, testcaseName);
+};
+
class ReferenceLSTMCellTest : public testing::TestWithParam, public CommonReferenceTest {
public:
void SetUp() override {
@@ -63,26 +73,24 @@ public:
result << "_hoType=" << param.Ho.type;
result << "_hoShape=" << param.Ho.shape;
result << "_coType=" << param.Co.type;
+ result << "_coShape=" << param.Co.shape;
if (param.testcaseName != "") {
- result << "_coShape=" << param.Co.shape;
result << "_=" << param.testcaseName;
- } else {
- result << "_coShape=" << param.Co.shape;
}
return result.str();
}
private:
static std::shared_ptr CreateFunction(const LSTMCellParams& params) {
- const auto X = std::make_shared(params.X.type, params.X.shape);
- const auto W = std::make_shared(params.W.type, params.W.shape);
- const auto R = std::make_shared(params.R.type, params.R.shape);
- const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
- const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
- const auto B = std::make_shared(params.B.type, params.B.shape);
+ const auto X = std::make_shared(params.X.type, params.X.shape);
+ const auto W = std::make_shared(params.W.type, params.W.shape);
+ const auto R = std::make_shared(params.R.type, params.R.shape);
+ const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
+ const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
+ const auto B = std::make_shared(params.B.type, params.B.shape);
const auto lstm_cell =
- std::make_shared(X,
+ std::make_shared(X,
H_t,
C_t,
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
@@ -107,15 +115,15 @@ public:
private:
static std::shared_ptr CreateFunction(const LSTMCellParams& params) {
- const auto X = std::make_shared(params.X.type, params.X.shape);
- const auto W = std::make_shared(params.W.type, params.W.shape);
- const auto R = std::make_shared(params.R.type, params.R.shape);
- const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
- const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
- const auto B = std::make_shared(params.B.type, params.B.shape);
+ const auto X = std::make_shared(params.X.type, params.X.shape);
+ const auto W = std::make_shared(params.W.type, params.W.shape);
+ const auto R = std::make_shared(params.R.type, params.R.shape);
+ const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
+ const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
+ const auto B = std::make_shared(params.B.type, params.B.shape);
const auto lstm_cell =
- std::make_shared(X,
+ std::make_shared(X,
H_t,
C_t,
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
@@ -142,15 +150,15 @@ private:
static std::shared_ptr CreateFunction(const LSTMCellParams& params) {
const float clip_threshold = 3.5f;
- const auto X = std::make_shared(params.X.type, params.X.shape);
- const auto W = std::make_shared(params.W.type, params.W.shape);
- const auto R = std::make_shared(params.R.type, params.R.shape);
- const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
- const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
- const auto B = std::make_shared(params.B.type, params.B.shape);
+ const auto X = std::make_shared(params.X.type, params.X.shape);
+ const auto W = std::make_shared(params.W.type, params.W.shape);
+ const auto R = std::make_shared(params.R.type, params.R.shape);
+ const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
+ const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
+ const auto B = std::make_shared(params.B.type, params.B.shape);
const auto lstm_cell =
- std::make_shared(X,
+ std::make_shared(X,
H_t,
C_t,
W,
@@ -179,36 +187,130 @@ TEST_P(ReferenceLSTMCellTestBiasClip, CompareWithRefs) {
Exec();
}
+class ReferenceLSTMCellV1Test : public ReferenceLSTMCellTest {
+private:
+ static std::shared_ptr CreateFunction(const LSTMCellParams& params) {
+ const auto X = std::make_shared(params.X.type, params.X.shape);
+ const auto W = std::make_shared(params.W.type, params.W.shape);
+ const auto R = std::make_shared(params.R.type, params.R.shape);
+ const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
+ const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
+ const auto B = std::make_shared(params.B.type, params.B.shape);
+
+ const auto lstm_cell =
+ std::make_shared(X,
+ H_t,
+ C_t,
+ op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
+ op::util::convert_lstm_node_format(R, op::util::LSTMWeightsFormat::IOFC),
+ op::util::convert_lstm_node_format(B, op::util::LSTMWeightsFormat::IOFC),
+ params.hiddenSize);
+
+ auto function = std::make_shared(lstm_cell->outputs(), ParameterVector{X, H_t, C_t, W, R, B});
+ return function;
+ }
+};
+
+class ReferenceLSTMCellV1TestBiasDefaultAttrs : public ReferenceLSTMCellTestBiasDefaultAttrs {
+private:
+ static std::shared_ptr CreateFunction(const LSTMCellParams& params) {
+ const auto X = std::make_shared(params.X.type, params.X.shape);
+ const auto W = std::make_shared(params.W.type, params.W.shape);
+ const auto R = std::make_shared(params.R.type, params.R.shape);
+ const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
+ const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
+ const auto B = std::make_shared(params.B.type, params.B.shape);
+
+ const auto lstm_cell =
+ std::make_shared(X,
+ H_t,
+ C_t,
+ op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
+ op::util::convert_lstm_node_format(R, op::util::LSTMWeightsFormat::IOFC),
+ op::util::convert_lstm_node_format(B, op::util::LSTMWeightsFormat::IOFC),
+ params.hiddenSize);
+
+ auto function = std::make_shared(lstm_cell->outputs(), ParameterVector{X, H_t, C_t, W, R, B});
+ return function;
+ }
+};
+
+class ReferenceLSTMCellV1TestBiasClip : public ReferenceLSTMCellTestBiasClip {
+private:
+ static std::shared_ptr CreateFunction(const LSTMCellParams& params) {
+ const float clip_threshold = 3.5f;
+
+ const auto X = std::make_shared(params.X.type, params.X.shape);
+ const auto W = std::make_shared(params.W.type, params.W.shape);
+ const auto R = std::make_shared(params.R.type, params.R.shape);
+ const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape);
+ const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape);
+ const auto B = std::make_shared(params.B.type, params.B.shape);
+
+ const auto lstm_cell =
+ std::make_shared(X,
+ H_t,
+ C_t,
+ W,
+ R,
+ B,
+ params.hiddenSize,
+ op::LSTMWeightsFormat::IFCO,
+ std::vector{"sigmoid", "tanh", "tanh"},
+ std::vector{},
+ std::vector{},
+ clip_threshold);
+
+ auto function = std::make_shared(lstm_cell->outputs(), ParameterVector{X, H_t, C_t, W, R, B});
+ return function;
+ }
+};
+
+TEST_P(ReferenceLSTMCellV1Test, CompareWithRefs) {
+ Exec();
+}
+
+TEST_P(ReferenceLSTMCellV1TestBiasDefaultAttrs, CompareWithRefs) {
+ Exec();
+}
+
+TEST_P(ReferenceLSTMCellV1TestBiasClip, CompareWithRefs) {
+ Exec();
+}
+
template
std::vector generateParams() {
using T = typename element_type_traits::value_type;
std::vector params {
- LSTMCellParams(
- 2, 3, 3, 4,
- Tensor(ET, {2, 3}, std::vector{
- 0.81342685f, 0.84108883f, 0.8152282f, 0.46893653f, 0.0901856f, 0.37088776f}),
- Tensor(ET, {4 * 3, 3}, std::vector{
- 3.3330739e-01f, 3.6229487e-04f, 4.6773660e-01f, 4.3046016e-01f, 7.3950343e-02f, 3.8063636e-01f,
- 9.6921772e-01f, 9.6897459e-01f, 6.2964785e-01f, 3.1134409e-01f, 8.4709978e-01f, 9.4928098e-01f,
- 6.1676943e-01f, 6.6020679e-01f, 1.9072217e-01f, 8.8032126e-02f, 4.0472135e-01f, 6.8342745e-01f,
- 8.3432144e-01f, 4.4928190e-01f, 7.9524308e-01f, 5.3966165e-01f, 8.5936421e-01f, 8.3136767e-01f,
- 5.5125546e-02f, 4.7791195e-01f, 3.5788772e-01f, 6.7507404e-01f, 2.1716513e-01f, 2.7473119e-01f,
- 3.3999152e-02f, 9.6835363e-01f, 3.7581277e-01f, 2.4026000e-01f, 6.7418844e-01f, 3.4199652e-01f}),
- Tensor(ET, {4 * 3, 3}, std::vector{
- 0.0987983f, 0.52032113f, 0.5848073f, 0.5356095f, 0.74497133f, 0.73260087f,
- 0.1700787f, 0.45684233f, 0.1495722f, 0.42734373f, 0.4433832f, 0.25906256f,
- 0.03854987f, 0.47480518f, 0.37215272f, 0.99890584f, 0.74019486f, 0.3518967f,
- 0.6881257f, 0.8170279f, 0.54088944f, 0.81225616f, 0.14619833f, 0.42941234f,
- 0.86843914f, 0.45967972f, 0.6237719f, 0.11074839f, 0.6029616f, 0.3149305f,
- 0.46504205f, 0.5843412f, 0.8733427f, 0.7687243f, 0.07074859f, 0.39188156f}),
- Tensor(ET, {2, 3}, std::vector{
- 0.77956f, 0.5331557f, 0.04297554f, 0.7962175f, 0.7635707f, 0.11989366f}),
- Tensor(ET, {2, 3}, std::vector{
- 0.8488452f, 0.18851636f, 0.5020695f, 0.29716516f, 0.06740791f, 0.45384037f}),
- Tensor(ET, {4 * 3}, std::vector(4 * 3, 0.f)),
- Tensor(ET, {2, 3}, std::vector{0.81457126f, 0.61109227f, 0.769522f, 0.52239674f, 0.4324641f, 0.63183f}),
- Tensor(ET, {2, 3}, std::vector{1.4444952f, 0.9635685f, 1.2875274f, 0.8053419f, 0.7184521f, 0.95803297f}),
- "lstm_cell_zero_bias_default_attrs"),
+ Builder {}
+ .batchSize(2)
+ .inputSize(3)
+ .hiddenSize(3)
+ .gatesCount(4)
+ .X(Tensor(ET, {2, 3}, std::vector{
+ 0.81342685f, 0.84108883f, 0.8152282f, 0.46893653f, 0.0901856f, 0.37088776f}))
+ .W(Tensor(ET, {4 * 3, 3}, std::vector{
+ 3.3330739e-01f, 3.6229487e-04f, 4.6773660e-01f, 4.3046016e-01f, 7.3950343e-02f, 3.8063636e-01f,
+ 9.6921772e-01f, 9.6897459e-01f, 6.2964785e-01f, 3.1134409e-01f, 8.4709978e-01f, 9.4928098e-01f,
+ 6.1676943e-01f, 6.6020679e-01f, 1.9072217e-01f, 8.8032126e-02f, 4.0472135e-01f, 6.8342745e-01f,
+ 8.3432144e-01f, 4.4928190e-01f, 7.9524308e-01f, 5.3966165e-01f, 8.5936421e-01f, 8.3136767e-01f,
+ 5.5125546e-02f, 4.7791195e-01f, 3.5788772e-01f, 6.7507404e-01f, 2.1716513e-01f, 2.7473119e-01f,
+ 3.3999152e-02f, 9.6835363e-01f, 3.7581277e-01f, 2.4026000e-01f, 6.7418844e-01f, 3.4199652e-01f}))
+ .R(Tensor(ET, {4 * 3, 3}, std::vector{
+ 0.0987983f, 0.52032113f, 0.5848073f, 0.5356095f, 0.74497133f, 0.73260087f,
+ 0.1700787f, 0.45684233f, 0.1495722f, 0.42734373f, 0.4433832f, 0.25906256f,
+ 0.03854987f, 0.47480518f, 0.37215272f, 0.99890584f, 0.74019486f, 0.3518967f,
+ 0.6881257f, 0.8170279f, 0.54088944f, 0.81225616f, 0.14619833f, 0.42941234f,
+ 0.86843914f, 0.45967972f, 0.6237719f, 0.11074839f, 0.6029616f, 0.3149305f,
+ 0.46504205f, 0.5843412f, 0.8733427f, 0.7687243f, 0.07074859f, 0.39188156f}))
+ .H_t(Tensor(ET, {2, 3}, std::vector{
+ 0.77956f, 0.5331557f, 0.04297554f, 0.7962175f, 0.7635707f, 0.11989366f}))
+ .C_t(Tensor(ET, {2, 3}, std::vector{
+ 0.8488452f, 0.18851636f, 0.5020695f, 0.29716516f, 0.06740791f, 0.45384037f}))
+ .B(Tensor(ET, {4 * 3}, std::vector(4 * 3, 0.f)))
+ .Ho(Tensor(ET, {2, 3}, std::vector{0.81457126f, 0.61109227f, 0.769522f, 0.52239674f, 0.4324641f, 0.63183f}))
+ .Co(Tensor(ET, {2, 3}, std::vector{1.4444952f, 0.9635685f, 1.2875274f, 0.8053419f, 0.7184521f, 0.95803297f}))
+ .testcaseName("lstm_cell_zero_bias_default_attrs")
};
return params;
}
@@ -232,53 +334,56 @@ template
std::vector generateParamsBiasDefaultAttrs() {
using T = typename element_type_traits::value_type;
std::vector params {
- LSTMCellParams(
- 2, 3, 3, 4,
- Tensor(ET, {2, 3}, std::vector{
- 0.81342685f, 0.84108883f, 0.8152282f, 0.46893653f, 0.0901856f, 0.37088776f}),
- Tensor(ET, {4 * 3, 3}, std::vector{
- 3.3330739e-01f, 3.6229487e-04f, 4.6773660e-01f, 4.3046016e-01f, 7.3950343e-02f, 3.8063636e-01f,
- 9.6921772e-01f, 9.6897459e-01f, 6.2964785e-01f, 3.1134409e-01f, 8.4709978e-01f, 9.4928098e-01f,
- 6.1676943e-01f, 6.6020679e-01f, 1.9072217e-01f, 8.8032126e-02f, 4.0472135e-01f, 6.8342745e-01f,
- 8.3432144e-01f, 4.4928190e-01f, 7.9524308e-01f, 5.3966165e-01f, 8.5936421e-01f, 8.3136767e-01f,
- 5.5125546e-02f, 4.7791195e-01f, 3.5788772e-01f, 6.7507404e-01f, 2.1716513e-01f, 2.7473119e-01f,
- 3.3999152e-02f, 9.6835363e-01f, 3.7581277e-01f, 2.4026000e-01f, 6.7418844e-01f, 3.4199652e-01f}),
- Tensor(ET, {4 * 3, 3}, std::vector{
- 0.0987983f, 0.52032113f, 0.5848073f, 0.5356095f, 0.74497133f, 0.73260087f,
- 0.1700787f, 0.45684233f, 0.1495722f, 0.42734373f, 0.4433832f, 0.25906256f,
- 0.03854987f, 0.47480518f, 0.37215272f, 0.99890584f, 0.74019486f, 0.3518967f,
- 0.6881257f, 0.8170279f, 0.54088944f, 0.81225616f, 0.14619833f, 0.42941234f,
- 0.86843914f, 0.45967972f, 0.6237719f, 0.11074839f, 0.6029616f, 0.3149305f,
- 0.46504205f, 0.5843412f, 0.8733427f, 0.7687243f, 0.07074859f, 0.39188156f}),
- Tensor(ET, {2, 3}, std::vector{
- 0.77956f, 0.5331557f, 0.04297554f, 0.7962175f, 0.7635707f, 0.11989366f}),
- Tensor(ET, {2, 3}, std::vector{
- 0.8488452f, 0.18851636f, 0.5020695f, 0.29716516f, 0.06740791f, 0.45384037f}),
- Tensor(ET, {4 * 3}, std::vector{1.07393714f,
- 1.15248052f,
- 1.16671345f,
- 0.21450312f,
- 1.2380678f,
- 1.51688835f,
- 0.46718366f,
- 0.91810346f,
- 1.1274234f,
- 0.51022074f,
- 1.11389844f,
- 0.74174305f}),
- Tensor(ET, {2, 3}, std::vector{0.81014400720596313,
+ Builder {}
+ .batchSize(2)
+ .inputSize(3)
+ .hiddenSize(3)
+ .gatesCount(4)
+ .X(Tensor(ET, {2, 3}, std::vector{
+ 0.81342685f, 0.84108883f, 0.8152282f, 0.46893653f, 0.0901856f, 0.37088776f}))
+ .W(Tensor(ET, {4 * 3, 3}, std::vector{
+ 3.3330739e-01f, 3.6229487e-04f, 4.6773660e-01f, 4.3046016e-01f, 7.3950343e-02f, 3.8063636e-01f,
+ 9.6921772e-01f, 9.6897459e-01f, 6.2964785e-01f, 3.1134409e-01f, 8.4709978e-01f, 9.4928098e-01f,
+ 6.1676943e-01f, 6.6020679e-01f, 1.9072217e-01f, 8.8032126e-02f, 4.0472135e-01f, 6.8342745e-01f,
+ 8.3432144e-01f, 4.4928190e-01f, 7.9524308e-01f, 5.3966165e-01f, 8.5936421e-01f, 8.3136767e-01f,
+ 5.5125546e-02f, 4.7791195e-01f, 3.5788772e-01f, 6.7507404e-01f, 2.1716513e-01f, 2.7473119e-01f,
+ 3.3999152e-02f, 9.6835363e-01f, 3.7581277e-01f, 2.4026000e-01f, 6.7418844e-01f, 3.4199652e-01f}))
+ .R(Tensor(ET, {4 * 3, 3}, std::vector{
+ 0.0987983f, 0.52032113f, 0.5848073f, 0.5356095f, 0.74497133f, 0.73260087f,
+ 0.1700787f, 0.45684233f, 0.1495722f, 0.42734373f, 0.4433832f, 0.25906256f,
+ 0.03854987f, 0.47480518f, 0.37215272f, 0.99890584f, 0.74019486f, 0.3518967f,
+ 0.6881257f, 0.8170279f, 0.54088944f, 0.81225616f, 0.14619833f, 0.42941234f,
+ 0.86843914f, 0.45967972f, 0.6237719f, 0.11074839f, 0.6029616f, 0.3149305f,
+ 0.46504205f, 0.5843412f, 0.8733427f, 0.7687243f, 0.07074859f, 0.39188156f}))
+ .H_t(Tensor(ET, {2, 3}, std::vector{
+ 0.77956f, 0.5331557f, 0.04297554f, 0.7962175f, 0.7635707f, 0.11989366f}))
+ .C_t(Tensor(ET, {2, 3}, std::vector{
+ 0.8488452f, 0.18851636f, 0.5020695f, 0.29716516f, 0.06740791f, 0.45384037f}))
+ .B(Tensor(ET, {4 * 3}, std::vector{1.07393714f,
+ 1.15248052f,
+ 1.16671345f,
+ 0.21450312f,
+ 1.2380678f,
+ 1.51688835f,
+ 0.46718366f,
+ 0.91810346f,
+ 1.1274234f,
+ 0.51022074f,
+ 1.11389844f,
+ 0.74174305f}))
+ .Ho(Tensor(ET, {2, 3}, std::vector{0.81014400720596313,
0.76665538549423218,
0.82509011030197144,
0.6479143500328064,
0.66586339473724365,
- 0.74838578701019287}),
- Tensor(ET, {2, 3}, std::vector{1.6800162792205811,
+ 0.74838578701019287}))
+ .Co(Tensor(ET, {2, 3}, std::vector{1.6800162792205811,
1.1150213479995728,
1.4578367471694946,
1.0649888515472412,
0.93761754035949707,
- 1.3659683465957642}),
- "lstm_cell_bias_default_attrs"),
+ 1.3659683465957642}))
+ .testcaseName("lstm_cell_bias_default_attrs"),
};
return params;
}
@@ -302,53 +407,56 @@ template
std::vector generateParamsBiasClip() {
using T = typename element_type_traits::value_type;
std::vector params {
- LSTMCellParams(
- 2, 3, 3, 4,
- Tensor(ET, {2, 3}, std::vector{
- 0.81342685f, 0.84108883f, 0.8152282f, 0.46893653f, 0.0901856f, 0.37088776f}),
- Tensor(ET, {4 * 3, 3}, std::vector{
- 3.3330739e-01f, 3.6229487e-04f, 4.6773660e-01f, 4.3046016e-01f, 7.3950343e-02f, 3.8063636e-01f,
- 9.6921772e-01f, 9.6897459e-01f, 6.2964785e-01f, 3.1134409e-01f, 8.4709978e-01f, 9.4928098e-01f,
- 6.1676943e-01f, 6.6020679e-01f, 1.9072217e-01f, 8.8032126e-02f, 4.0472135e-01f, 6.8342745e-01f,
- 8.3432144e-01f, 4.4928190e-01f, 7.9524308e-01f, 5.3966165e-01f, 8.5936421e-01f, 8.3136767e-01f,
- 5.5125546e-02f, 4.7791195e-01f, 3.5788772e-01f, 6.7507404e-01f, 2.1716513e-01f, 2.7473119e-01f,
- 3.3999152e-02f, 9.6835363e-01f, 3.7581277e-01f, 2.4026000e-01f, 6.7418844e-01f, 3.4199652e-01f}),
- Tensor(ET, {4 * 3, 3}, std::vector{
- 0.0987983f, 0.52032113f, 0.5848073f, 0.5356095f, 0.74497133f, 0.73260087f,
- 0.1700787f, 0.45684233f, 0.1495722f, 0.42734373f, 0.4433832f, 0.25906256f,
- 0.03854987f, 0.47480518f, 0.37215272f, 0.99890584f, 0.74019486f, 0.3518967f,
- 0.6881257f, 0.8170279f, 0.54088944f, 0.81225616f, 0.14619833f, 0.42941234f,
- 0.86843914f, 0.45967972f, 0.6237719f, 0.11074839f, 0.6029616f, 0.3149305f,
- 0.46504205f, 0.5843412f, 0.8733427f, 0.7687243f, 0.07074859f, 0.39188156f}),
- Tensor(ET, {2, 3}, std::vector{
- 0.77956f, 0.5331557f, 0.04297554f, 0.7962175f, 0.7635707f, 0.11989366f}),
- Tensor(ET, {2, 3}, std::vector{
- 0.8488452f, 0.18851636f, 0.5020695f, 0.29716516f, 0.06740791f, 0.45384037f}),
- Tensor(ET, {4 * 3}, std::vector{1.07393714f,
- 1.15248052f,
- 1.16671345f,
- 0.21450312f,
- 1.2380678f,
- 1.51688835f,
- 0.46718366f,
- 0.91810346f,
- 1.1274234f,
- 0.51022074f,
- 1.11389844f,
- 0.74174305f}),
- Tensor(ET, {2, 3}, std::vector{0.81014400720596313,
+ Builder {}
+ .batchSize(2)
+ .inputSize(3)
+ .hiddenSize(3)
+ .gatesCount(4)
+ .X(Tensor(ET, {2, 3}, std::vector{
+ 0.81342685f, 0.84108883f, 0.8152282f, 0.46893653f, 0.0901856f, 0.37088776f}))
+ .W(Tensor(ET, {4 * 3, 3}, std::vector{
+ 3.3330739e-01f, 3.6229487e-04f, 4.6773660e-01f, 4.3046016e-01f, 7.3950343e-02f, 3.8063636e-01f,
+ 9.6921772e-01f, 9.6897459e-01f, 6.2964785e-01f, 3.1134409e-01f, 8.4709978e-01f, 9.4928098e-01f,
+ 6.1676943e-01f, 6.6020679e-01f, 1.9072217e-01f, 8.8032126e-02f, 4.0472135e-01f, 6.8342745e-01f,
+ 8.3432144e-01f, 4.4928190e-01f, 7.9524308e-01f, 5.3966165e-01f, 8.5936421e-01f, 8.3136767e-01f,
+ 5.5125546e-02f, 4.7791195e-01f, 3.5788772e-01f, 6.7507404e-01f, 2.1716513e-01f, 2.7473119e-01f,
+ 3.3999152e-02f, 9.6835363e-01f, 3.7581277e-01f, 2.4026000e-01f, 6.7418844e-01f, 3.4199652e-01f}))
+ .R(Tensor(ET, {4 * 3, 3}, std::vector{
+ 0.0987983f, 0.52032113f, 0.5848073f, 0.5356095f, 0.74497133f, 0.73260087f,
+ 0.1700787f, 0.45684233f, 0.1495722f, 0.42734373f, 0.4433832f, 0.25906256f,
+ 0.03854987f, 0.47480518f, 0.37215272f, 0.99890584f, 0.74019486f, 0.3518967f,
+ 0.6881257f, 0.8170279f, 0.54088944f, 0.81225616f, 0.14619833f, 0.42941234f,
+ 0.86843914f, 0.45967972f, 0.6237719f, 0.11074839f, 0.6029616f, 0.3149305f,
+ 0.46504205f, 0.5843412f, 0.8733427f, 0.7687243f, 0.07074859f, 0.39188156f}))
+ .H_t(Tensor(ET, {2, 3}, std::vector{
+ 0.77956f, 0.5331557f, 0.04297554f, 0.7962175f, 0.7635707f, 0.11989366f}))
+ .C_t(Tensor(ET, {2, 3}, std::vector{
+ 0.8488452f, 0.18851636f, 0.5020695f, 0.29716516f, 0.06740791f, 0.45384037f}))
+ .B(Tensor(ET, {4 * 3}, std::vector{1.07393714f,
+ 1.15248052f,
+ 1.16671345f,
+ 0.21450312f,
+ 1.2380678f,
+ 1.51688835f,
+ 0.46718366f,
+ 0.91810346f,
+ 1.1274234f,
+ 0.51022074f,
+ 1.11389844f,
+ 0.74174305f}))
+ .Ho(Tensor(ET, {2, 3}, std::vector{0.81014400720596313,
0.76665538549423218,
0.82387429475784302,
0.6479143500328064,
0.66586339473724365,
- 0.74838578701019287}),
- Tensor(ET, {2, 3}, std::vector{1.6800162792205811,
+ 0.74838578701019287}))
+ .Co(Tensor(ET, {2, 3}, std::vector{1.6800162792205811,
1.1150213479995728,
1.4510968923568726,
1.0649888515472412,
0.93761754035949707,
- 1.3659683465957642}),
- "lstm_cell_bias_clip"),
+ 1.3659683465957642}))
+ .testcaseName("lstm_cell_bias_clip"),
};
return params;
}
@@ -376,4 +484,211 @@ INSTANTIATE_TEST_SUITE_P(smoke_LSTMCell_With_Hardcoded_Refs, ReferenceLSTMCellTe
INSTANTIATE_TEST_SUITE_P(smoke_LSTMCell_With_Hardcoded_Refs, ReferenceLSTMCellTestBiasClip,
testing::ValuesIn(generateCombinedParamsBiasClip()), ReferenceLSTMCellTest::getTestCaseName);
-} // namespace
+
+template
+std::vector generateParamsV1() {
+ using T = typename element_type_traits::value_type;
+ std::vector params {
+ Builder {}
+ .batchSize(2)
+ .inputSize(3)
+ .hiddenSize(3)
+ .gatesCount(4)
+ .X(Tensor(ET, {2, 3}, std::vector{
+ 0.81342685f, 0.84108883f, 0.8152282f, 0.46893653f, 0.0901856f, 0.37088776f}))
+ .W(Tensor(ET, {4 * 3, 3}, std::vector{
+ 3.3330739e-01f, 3.6229487e-04f, 4.6773660e-01f, 4.3046016e-01f, 7.3950343e-02f, 3.8063636e-01f,
+ 9.6921772e-01f, 9.6897459e-01f, 6.2964785e-01f, 3.1134409e-01f, 8.4709978e-01f, 9.4928098e-01f,
+ 6.1676943e-01f, 6.6020679e-01f, 1.9072217e-01f, 8.8032126e-02f, 4.0472135e-01f, 6.8342745e-01f,
+ 8.3432144e-01f, 4.4928190e-01f, 7.9524308e-01f, 5.3966165e-01f, 8.5936421e-01f, 8.3136767e-01f,
+ 5.5125546e-02f, 4.7791195e-01f, 3.5788772e-01f, 6.7507404e-01f, 2.1716513e-01f, 2.7473119e-01f,
+ 3.3999152e-02f, 9.6835363e-01f, 3.7581277e-01f, 2.4026000e-01f, 6.7418844e-01f, 3.4199652e-01f}))
+ .R(Tensor(ET, {4 * 3, 3}, std::vector