Use protobuf-lite for ONNX FE by default (#6829)
This commit is contained in:
parent
5bafab9e72
commit
c38f08b777
|
|
@ -168,6 +168,7 @@ jobs:
|
|||
- script: |
|
||||
export FE_TEST_MODELS=$(INSTALL_DIR)/tests
|
||||
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
workingDirectory: $(INSTALL_TEST_DIR)
|
||||
displayName: 'nGraph UT'
|
||||
continueOnError: false
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ jobs:
|
|||
displayName: 'Install'
|
||||
|
||||
- script: $(BIN_DIR)/unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU*:IE_CPU.onnx_model_sigmoid:IE_CPU/GRUSequenceOp.onnx_model_gru* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
workingDirectory: $(BIN_DIR)
|
||||
displayName: 'nGraph UT'
|
||||
continueOnError: false
|
||||
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ jobs:
|
|||
- script: |
|
||||
set FE_TEST_MODELS=$(INSTALL_DIR)\tests
|
||||
call $(SETUPVARS) && $(INSTALL_TEST_DIR)\unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
|
||||
workingDirectory: $(INSTALL_TEST_DIR)
|
||||
displayName: 'nGraph UT'
|
||||
continueOnError: false
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ endfunction()
|
|||
ie_cpack_add_component(ngraph REQUIRED)
|
||||
ie_cpack_add_component(ngraph_dev REQUIRED DEPENDS ngraph)
|
||||
|
||||
# add target with processed tests model zoo
|
||||
include(cmake/test_model_zoo.cmake)
|
||||
|
||||
add_subdirectory(thirdparty)
|
||||
add_subdirectory(openvino)
|
||||
add_subdirectory(ngraph)
|
||||
|
|
|
|||
|
|
@ -44,13 +44,9 @@ ie_option (BUILD_SHARED_LIBS "Build as a shared library" ON)
|
|||
|
||||
ie_dependent_option (ENABLE_FASTER_BUILD "Enable build features (PCH, UNITY) to speed up build time" OFF "CMAKE_VERSION VERSION_GREATER_EQUAL 3.16" OFF)
|
||||
|
||||
if(NOT DEFINED ENABLE_CPPLINT)
|
||||
ie_dependent_option (ENABLE_CPPLINT "Enable cpplint checks during the build" ON "UNIX;NOT ANDROID" OFF)
|
||||
endif()
|
||||
ie_dependent_option (ENABLE_CPPLINT "Enable cpplint checks during the build" ON "UNIX;NOT ANDROID" OFF)
|
||||
|
||||
if(NOT DEFINED ENABLE_CPPLINT_REPORT)
|
||||
ie_dependent_option (ENABLE_CPPLINT_REPORT "Build cpplint report instead of failing the build" OFF "ENABLE_CPPLINT" OFF)
|
||||
endif()
|
||||
ie_dependent_option (ENABLE_CPPLINT_REPORT "Build cpplint report instead of failing the build" OFF "ENABLE_CPPLINT" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_CLANG_FORMAT "Enable clang-format checks during the build" ON "UNIX;NOT ANDROID" OFF)
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ ie_dependent_option (ENABLE_FUNCTIONAL_TESTS "functional tests" ON "ENABLE_TESTS
|
|||
|
||||
ie_dependent_option (ENABLE_SAMPLES "console samples are part of inference engine package" ON "NOT MINGW" OFF)
|
||||
|
||||
ie_dependent_option (ENABLE_SPEECH_DEMO "enable speech demo integration" ON "NOT APPLE;NOT ANDROID;X86 OR X86_64" OFF)
|
||||
ie_dependent_option (ENABLE_SPEECH_DEMO "enable speech demo integration" ON "NOT APPLE;NOT ANDROID;X86_64" OFF)
|
||||
|
||||
ie_option (ENABLE_OPENCV "enables OpenCV" ON)
|
||||
|
||||
|
|
@ -125,8 +125,8 @@ endif()
|
|||
ie_dependent_option(NGRAPH_ONNX_IMPORT_ENABLE "Enable ONNX importer" ON "protoc_available" OFF)
|
||||
ie_dependent_option(NGRAPH_ONNX_FRONTEND_ENABLE "Enable ONNX FrontEnd" OFF "NGRAPH_ONNX_IMPORT_ENABLE" OFF)
|
||||
ie_dependent_option(NGRAPH_PDPD_FRONTEND_ENABLE "Enable PaddlePaddle FrontEnd" ON "protoc_available" OFF)
|
||||
ie_dependent_option(NGRAPH_USE_PROTOBUF_LITE "Compiles and links with protobuf-lite" OFF
|
||||
"NGRAPH_ONNX_IMPORT_ENABLE OR NGRAPH_PDPD_FRONTEND_ENABLE" OFF)
|
||||
ie_dependent_option(NGRAPH_USE_PROTOBUF_LITE "Compiles and links with protobuf-lite" ON
|
||||
"NGRAPH_ONNX_IMPORT_ENABLE" OFF)
|
||||
ie_dependent_option(NGRAPH_USE_SYSTEM_PROTOBUF "Use system protobuf" OFF
|
||||
"NGRAPH_ONNX_IMPORT_ENABLE OR NGRAPH_PDPD_FRONTEND_ENABLE" OFF)
|
||||
ie_dependent_option(NGRAPH_UNIT_TEST_ENABLE "Enables ngraph unit tests" ON "ENABLE_TESTS;NOT ANDROID" OFF)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,128 @@
|
|||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function(ov_model_convert SRC DST OUT)
|
||||
set(onnx_gen_script ${OpenVINO_SOURCE_DIR}/ngraph/test/models/onnx/onnx_prototxt_converter.py)
|
||||
|
||||
file(GLOB_RECURSE prototxt_models RELATIVE "${SRC}" "${SRC}/*.prototxt")
|
||||
file(GLOB_RECURSE xml_models RELATIVE "${SRC}" "${SRC}/*.xml")
|
||||
file(GLOB_RECURSE bin_models RELATIVE "${SRC}" "${SRC}/*.bin")
|
||||
file(GLOB_RECURSE onnx_models RELATIVE "${SRC}" "${SRC}/*.onnx")
|
||||
file(GLOB_RECURSE data_models RELATIVE "${SRC}" "${SRC}/*.data")
|
||||
|
||||
foreach(in_file IN LISTS prototxt_models xml_models bin_models onnx_models data_models)
|
||||
get_filename_component(ext "${in_file}" EXT)
|
||||
get_filename_component(rel_dir "${in_file}" DIRECTORY)
|
||||
get_filename_component(name_we "${in_file}" NAME_WE)
|
||||
set(model_source_dir "${SRC}/${rel_dir}")
|
||||
|
||||
if(NOT NGRAPH_ONNX_IMPORT_ENABLE AND ext MATCHES "^\\.(onnx|prototxt)$")
|
||||
# don't copy / process ONNX / prototxt files
|
||||
continue()
|
||||
endif()
|
||||
|
||||
if(ext STREQUAL ".prototxt")
|
||||
# convert model
|
||||
set(rel_out_name "${name_we}.onnx")
|
||||
if(rel_dir)
|
||||
set(rel_out_name "${rel_dir}/${rel_out_name}")
|
||||
endif()
|
||||
else()
|
||||
# copy as is
|
||||
set(rel_out_name "${in_file}")
|
||||
endif()
|
||||
|
||||
set(full_out_name "${DST}/${rel_out_name}")
|
||||
file(MAKE_DIRECTORY "${DST}/${rel_dir}")
|
||||
|
||||
if(ext STREQUAL ".prototxt")
|
||||
# convert .prototxt models to .onnx binary
|
||||
add_custom_command(OUTPUT ${full_out_name}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${onnx_gen_script}
|
||||
"${SRC}/${in_file}" ${full_out_name}
|
||||
DEPENDS ${onnx_gen_script} "${SRC}/${in_file}"
|
||||
COMMENT "Generate ${rel_out_name}"
|
||||
WORKING_DIRECTORY "${model_source_dir}")
|
||||
else()
|
||||
add_custom_command(OUTPUT ${full_out_name}
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${SRC}/${in_file}" ${full_out_name}
|
||||
DEPENDS ${onnx_gen_script} "${SRC}/${in_file}"
|
||||
COMMENT "Copy ${rel_out_name}"
|
||||
WORKING_DIRECTORY "${model_source_dir}")
|
||||
endif()
|
||||
list(APPEND files "${full_out_name}")
|
||||
endforeach()
|
||||
|
||||
set(${OUT} ${files} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
ov_model_convert("${CMAKE_CURRENT_SOURCE_DIR}/ngraph/test"
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/ngraph"
|
||||
onnx_out_files)
|
||||
|
||||
set(rel_path "inference-engine/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")
|
||||
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")
|
||||
ov_model_convert("${OpenVINO_SOURCE_DIR}/${rel_path}"
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/onnx_import"
|
||||
ie_onnx_import_out_files)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
# Note: paddlepaddle==2.1.0 is not found for 32bits architecture
|
||||
if(NGRAPH_ONNX_IMPORT_ENABLE)
|
||||
find_package(PythonInterp 3 REQUIRED)
|
||||
|
||||
get_filename_component(PYTHON_EXEC_DIR ${PYTHON_EXECUTABLE} DIRECTORY)
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -m pip --version
|
||||
WORKING_DIRECTORY ${PYTHON_EXEC_DIR}
|
||||
RESULT_VARIABLE pip3_exit_code
|
||||
OUTPUT_VARIABLE pip3_version)
|
||||
|
||||
if(NOT pip3_exit_code EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to extract pip module version")
|
||||
endif()
|
||||
|
||||
if(pip3_version MATCHES ".* ([0-9]+)+\.([0-9]+)([\.0-9 ]).*")
|
||||
set(pip3_version ${CMAKE_MATCH_1}.${CMAKE_MATCH_2})
|
||||
else()
|
||||
message(FATAL_ERROR "Failed to parse ${pip3_version}")
|
||||
endif()
|
||||
|
||||
message(STATUS "pip version is ${pip3_version}")
|
||||
set(args --quiet)
|
||||
if(pip3_version VERSION_GREATER 20.2.2)
|
||||
list(APPEND args --use-feature=2020-resolver)
|
||||
endif()
|
||||
|
||||
set(reqs "${OpenVINO_SOURCE_DIR}/ngraph/test/requirements_test_onnx.txt")
|
||||
add_custom_target(test_pip_prerequsites ALL
|
||||
"${PYTHON_EXECUTABLE}" -m pip install ${args} -r ${reqs}
|
||||
COMMENT "Install requirements_test.txt"
|
||||
VERBATIM
|
||||
SOURCES ${reqs})
|
||||
endif()
|
||||
|
||||
add_custom_target(test_model_zoo DEPENDS ${onnx_out_files}
|
||||
${ie_onnx_out_files}
|
||||
${ie_serialize_out_files}
|
||||
${ie_onnx_import_out_files})
|
||||
|
||||
if(TARGET test_pip_prerequsites)
|
||||
add_dependencies(test_model_zoo test_pip_prerequsites)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo"
|
||||
DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
|
||||
set(TEST_MODEL_ZOO "./test_model_zoo" CACHE PATH "Path to test model zoo")
|
||||
endif()
|
||||
|
|
@ -21,11 +21,6 @@ def model_onnx_path():
|
|||
test_onnx = os.path.join(path_to_repo, "models", "test_model", 'test_model.onnx')
|
||||
return test_onnx
|
||||
|
||||
def model_prototxt_path():
|
||||
path_to_repo = os.environ["MODELS_PATH"]
|
||||
test_prototxt = os.path.join(path_to_repo, "models", "test_model", 'test_model.prototxt')
|
||||
return test_prototxt
|
||||
|
||||
def image_path():
|
||||
path_to_repo = os.environ["DATA_PATH"]
|
||||
path_to_img = os.path.join(path_to_repo, 'validation_set', '224x224', 'dog.bmp')
|
||||
|
|
|
|||
|
|
@ -10,12 +10,11 @@ from time import sleep, time
|
|||
from queue import Queue
|
||||
|
||||
from openvino.inference_engine import IENetwork, IECore, ExecutableNetwork
|
||||
from conftest import model_path, plugins_path, model_onnx_path, model_prototxt_path
|
||||
from conftest import model_path, plugins_path, model_onnx_path
|
||||
|
||||
|
||||
test_net_xml, test_net_bin = model_path()
|
||||
test_net_onnx = model_onnx_path()
|
||||
test_net_prototxt = model_prototxt_path()
|
||||
plugins_xml, plugins_win_xml, plugins_osx_xml = plugins_path()
|
||||
|
||||
|
||||
|
|
@ -204,18 +203,6 @@ def test_read_network_from_onnx_as_path():
|
|||
assert isinstance(net, IENetwork)
|
||||
|
||||
|
||||
def test_read_network_from_prototxt():
|
||||
ie = IECore()
|
||||
net = ie.read_network(model=test_net_prototxt)
|
||||
assert isinstance(net, IENetwork)
|
||||
|
||||
|
||||
def test_read_network_from_prototxt_as_path():
|
||||
ie = IECore()
|
||||
net = ie.read_network(model=Path(test_net_prototxt))
|
||||
assert isinstance(net, IENetwork)
|
||||
|
||||
|
||||
def test_incorrect_xml():
|
||||
ie = IECore()
|
||||
with pytest.raises(Exception) as e:
|
||||
|
|
|
|||
|
|
@ -25,12 +25,16 @@ set(DEPENDENCIES
|
|||
mock_engine
|
||||
inference_engine_ir_reader
|
||||
inference_engine_ir_v7_reader
|
||||
HeteroPlugin
|
||||
AutoPlugin
|
||||
MultiDevicePlugin
|
||||
template_extension
|
||||
lptNgraphFunctions
|
||||
sharedTestClasses
|
||||
test_model_zoo
|
||||
)
|
||||
|
||||
if (NOT NGRAPH_ONNX_IMPORT_ENABLE OR NGRAPH_USE_PROTOBUF_LITE)
|
||||
if (NOT NGRAPH_ONNX_IMPORT_ENABLE)
|
||||
list(APPEND EXCLUDED_SOURCE_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/onnx_reader")
|
||||
endif()
|
||||
|
||||
|
|
@ -55,7 +59,7 @@ set_ie_threading_interface_for(${TARGET_NAME})
|
|||
if(NGRAPH_ONNX_IMPORT_ENABLE)
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
NGRAPH_ONNX_IMPORT_ENABLE
|
||||
ONNX_TEST_MODELS="${CMAKE_CURRENT_SOURCE_DIR}/onnx_reader/models/")
|
||||
ONNX_TEST_MODELS="${TEST_MODEL_ZOO}/onnx_reader/models/")
|
||||
add_dependencies(${TARGET_NAME} inference_engine_onnx_reader)
|
||||
endif()
|
||||
|
||||
|
|
@ -259,4 +263,5 @@ else()
|
|||
endif()
|
||||
|
||||
# ir serialization functional tests variables
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE IR_SERIALIZATION_MODELS_PATH="${CMAKE_CURRENT_SOURCE_DIR}/ir_serialization/models/")
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
IR_SERIALIZATION_MODELS_PATH="${TEST_MODEL_ZOO}/ir_serialization/models/")
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@
|
|||
#include "ie_core.hpp"
|
||||
#include "ngraph_functions/builders.hpp"
|
||||
|
||||
#ifndef IR_SERIALIZATION_MODELS_PATH // should be already defined by cmake
|
||||
#define IR_SERIALIZATION_MODELS_PATH ""
|
||||
#endif
|
||||
|
||||
class SerializationCleanupTest : public CommonTestUtils::TestsCommon {
|
||||
protected:
|
||||
const std::string test_name = GetTestName() + "_" + GetTimestamp();
|
||||
|
|
@ -21,7 +17,7 @@ protected:
|
|||
|
||||
void TearDown() override {
|
||||
std::remove(m_out_xml_path.c_str());
|
||||
std::remove(m_out_xml_path.c_str());
|
||||
std::remove(m_out_bin_path.c_str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@
|
|||
#include <ngraph/function.hpp>
|
||||
#include <transformations/serialize.hpp>
|
||||
|
||||
#ifndef IR_SERIALIZATION_MODELS_PATH // should be already defined by cmake
|
||||
#define IR_SERIALIZATION_MODELS_PATH ""
|
||||
#endif
|
||||
|
||||
class SerializatioConstantCompressionTest : public ::testing::Test {
|
||||
protected:
|
||||
std::string test_name =
|
||||
|
|
|
|||
|
|
@ -8,13 +8,14 @@
|
|||
#include <ie_api.h>
|
||||
#include <ie_iextension.h>
|
||||
#include <ie_network_reader.hpp>
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "ie_core.hpp"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "transformations/serialize.hpp"
|
||||
|
||||
#ifndef IR_SERIALIZATION_MODELS_PATH // should be already defined by cmake
|
||||
#define IR_SERIALIZATION_MODELS_PATH ""
|
||||
# error "IR_SERIALIZATION_MODELS_PATH is not defined"
|
||||
#endif
|
||||
|
||||
#ifndef IE_BUILD_POSTFIX // should be already defined by cmake
|
||||
|
|
@ -40,7 +41,8 @@ protected:
|
|||
};
|
||||
|
||||
TEST_F(CustomOpsSerializationTest, CustomOpUser_MO) {
|
||||
const std::string model = IR_SERIALIZATION_MODELS_PATH "custom_op.xml";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "custom_op.xml");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
ie.AddExtension(
|
||||
|
|
@ -62,7 +64,8 @@ TEST_F(CustomOpsSerializationTest, CustomOpUser_MO) {
|
|||
#ifdef NGRAPH_ONNX_IMPORT_ENABLE
|
||||
|
||||
TEST_F(CustomOpsSerializationTest, CustomOpUser_ONNXImporter) {
|
||||
const std::string model = IR_SERIALIZATION_MODELS_PATH "custom_op.prototxt";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "custom_op.onnx");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
ie.AddExtension(
|
||||
|
|
@ -84,7 +87,8 @@ TEST_F(CustomOpsSerializationTest, CustomOpUser_ONNXImporter) {
|
|||
#endif
|
||||
|
||||
TEST_F(CustomOpsSerializationTest, CustomOpTransformation) {
|
||||
const std::string model = IR_SERIALIZATION_MODELS_PATH "custom_op.xml";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "custom_op.xml");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto extension =
|
||||
|
|
@ -123,7 +127,8 @@ public:
|
|||
};
|
||||
|
||||
TEST_F(CustomOpsSerializationTest, CustomOpNoExtensions) {
|
||||
const std::string model = IR_SERIALIZATION_MODELS_PATH "custom_op.xml";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "custom_op.xml");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto extension = std::make_shared<FrameworkNodeExtension>();
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@
|
|||
|
||||
#include <fstream>
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ie_core.hpp"
|
||||
|
||||
#ifndef IR_SERIALIZATION_MODELS_PATH // should be already defined by cmake
|
||||
#define IR_SERIALIZATION_MODELS_PATH ""
|
||||
# error "IR_SERIALIZATION_MODELS_PATH is not defined"
|
||||
#endif
|
||||
|
||||
class SerializationDeterministicityTest : public ::testing::Test {
|
||||
|
|
@ -49,7 +50,8 @@ protected:
|
|||
#ifdef NGRAPH_ONNX_IMPORT_ENABLE
|
||||
|
||||
TEST_F(SerializationDeterministicityTest, BasicModel) {
|
||||
const std::string model = IR_SERIALIZATION_MODELS_PATH "add_abc.prototxt";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc.onnx");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto expected = ie.ReadNetwork(model);
|
||||
|
|
@ -66,8 +68,8 @@ TEST_F(SerializationDeterministicityTest, BasicModel) {
|
|||
}
|
||||
|
||||
TEST_F(SerializationDeterministicityTest, ModelWithMultipleLayers) {
|
||||
const std::string model =
|
||||
IR_SERIALIZATION_MODELS_PATH "addmul_abc.prototxt";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "addmul_abc.onnx");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto expected = ie.ReadNetwork(model);
|
||||
|
|
@ -86,10 +88,10 @@ TEST_F(SerializationDeterministicityTest, ModelWithMultipleLayers) {
|
|||
#endif
|
||||
|
||||
TEST_F(SerializationDeterministicityTest, ModelWithMultipleOutputs) {
|
||||
const std::string model =
|
||||
IR_SERIALIZATION_MODELS_PATH "split_equal_parts_2d.xml";
|
||||
const std::string weights =
|
||||
IR_SERIALIZATION_MODELS_PATH "split_equal_parts_2d.bin";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "split_equal_parts_2d.xml");
|
||||
const std::string weights = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "split_equal_parts_2d.bin");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto expected = ie.ReadNetwork(model, weights);
|
||||
|
|
@ -106,10 +108,10 @@ TEST_F(SerializationDeterministicityTest, ModelWithMultipleOutputs) {
|
|||
}
|
||||
|
||||
TEST_F(SerializationDeterministicityTest, ModelWithConstants) {
|
||||
const std::string model =
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.xml";
|
||||
const std::string weights =
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.bin";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.xml");
|
||||
const std::string weights = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.bin");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
auto expected = ie.ReadNetwork(model, weights);
|
||||
|
|
@ -126,10 +128,10 @@ TEST_F(SerializationDeterministicityTest, ModelWithConstants) {
|
|||
}
|
||||
|
||||
TEST_F(SerializationDeterministicityTest, SerializeToStream) {
|
||||
const std::string model =
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.xml";
|
||||
const std::string weights =
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.bin";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.xml");
|
||||
const std::string weights = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.bin");
|
||||
|
||||
std::stringstream m_out_xml_buf, m_out_bin_buf;
|
||||
InferenceEngine::Blob::Ptr binBlob;
|
||||
|
|
@ -154,10 +156,10 @@ TEST_F(SerializationDeterministicityTest, SerializeToStream) {
|
|||
}
|
||||
|
||||
TEST_F(SerializationDeterministicityTest, SerializeToBlob) {
|
||||
const std::string model =
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.xml";
|
||||
const std::string weights =
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.bin";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.xml");
|
||||
const std::string weights = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc_initializers.bin");
|
||||
|
||||
std::stringstream m_out_xml_buf;
|
||||
InferenceEngine::Blob::Ptr m_out_bin_buf;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
#include <fstream>
|
||||
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ie_core.hpp"
|
||||
|
||||
#ifndef IR_SERIALIZATION_MODELS_PATH // should be already defined by cmake
|
||||
#define IR_SERIALIZATION_MODELS_PATH ""
|
||||
# error "IR_SERIALIZATION_MODELS_PATH is not defined"
|
||||
#endif
|
||||
|
||||
typedef std::tuple<std::string, std::string> SerializationParams;
|
||||
|
|
@ -23,9 +24,11 @@ public:
|
|||
std::string m_out_bin_path;
|
||||
|
||||
void SetUp() override {
|
||||
m_model_path = IR_SERIALIZATION_MODELS_PATH + std::get<0>(GetParam());
|
||||
m_model_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH + std::get<0>(GetParam()));
|
||||
if (!std::get<1>(GetParam()).empty()) {
|
||||
m_binary_path = IR_SERIALIZATION_MODELS_PATH + std::get<1>(GetParam());
|
||||
m_binary_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH + std::get<1>(GetParam()));
|
||||
}
|
||||
|
||||
const std::string test_name = GetTestName() + "_" + GetTimestamp();
|
||||
|
|
@ -78,9 +81,9 @@ INSTANTIATE_TEST_SUITE_P(IRSerialization, SerializationTest,
|
|||
#ifdef NGRAPH_ONNX_IMPORT_ENABLE
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(ONNXSerialization, SerializationTest,
|
||||
testing::Values(std::make_tuple("add_abc.prototxt", ""),
|
||||
std::make_tuple("split_equal_parts_2d.prototxt", ""),
|
||||
std::make_tuple("addmul_abc.prototxt", ""),
|
||||
std::make_tuple("add_abc_initializers.prototxt", "")));
|
||||
testing::Values(std::make_tuple("add_abc.onnx", ""),
|
||||
std::make_tuple("split_equal_parts_2d.onnx", ""),
|
||||
std::make_tuple("addmul_abc.onnx", ""),
|
||||
std::make_tuple("add_abc_initializers.onnx", "")));
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <fstream>
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "gtest/gtest.h"
|
||||
#include "ie_core.hpp"
|
||||
|
|
@ -12,7 +13,7 @@
|
|||
#include "pugixml.hpp"
|
||||
|
||||
#ifndef IR_SERIALIZATION_MODELS_PATH // should be already defined by cmake
|
||||
#define IR_SERIALIZATION_MODELS_PATH ""
|
||||
# error "IR_SERIALIZATION_MODELS_PATH is not defined"
|
||||
#endif
|
||||
|
||||
class SerializationTensorIteratorTest : public ::testing::Test {
|
||||
|
|
@ -24,7 +25,7 @@ protected:
|
|||
|
||||
void TearDown() override {
|
||||
std::remove(m_out_xml_path.c_str());
|
||||
std::remove(m_out_xml_path.c_str());
|
||||
std::remove(m_out_bin_path.c_str());
|
||||
}
|
||||
|
||||
void serialize_and_compare(const std::string& model_path, InferenceEngine::Blob::Ptr weights) {
|
||||
|
|
@ -47,7 +48,8 @@ protected:
|
|||
};
|
||||
|
||||
TEST_F(SerializationTensorIteratorTest, TiResnet) {
|
||||
const std::string model_path = IR_SERIALIZATION_MODELS_PATH "ti_resnet.xml";
|
||||
const std::string model_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "ti_resnet.xml");
|
||||
|
||||
size_t weights_size = 8396840;
|
||||
|
||||
|
|
@ -67,7 +69,8 @@ TEST_F(SerializationTensorIteratorTest, TiResnet) {
|
|||
}
|
||||
|
||||
TEST_F(SerializationTensorIteratorTest, TiNegativeStride) {
|
||||
const std::string model_path = IR_SERIALIZATION_MODELS_PATH "ti_negative_stride.xml";
|
||||
const std::string model_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "ti_negative_stride.xml");
|
||||
|
||||
size_t weights_size = 3149864;
|
||||
|
||||
|
|
@ -87,8 +90,10 @@ TEST_F(SerializationTensorIteratorTest, TiNegativeStride) {
|
|||
}
|
||||
|
||||
TEST_F(SerializationTensorIteratorTest, SerializationExternalPortIdInXmlFile) {
|
||||
const std::string model_path = IR_SERIALIZATION_MODELS_PATH "loop_2d_add.xml";
|
||||
const std::string binary_path = IR_SERIALIZATION_MODELS_PATH "loop_2d_add.bin";
|
||||
const std::string model_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "loop_2d_add.xml");
|
||||
const std::string binary_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "loop_2d_add.bin");
|
||||
|
||||
InferenceEngine::Core ie;
|
||||
InferenceEngine::CNNNetwork expected;
|
||||
|
|
|
|||
|
|
@ -8,9 +8,10 @@
|
|||
#include "ie_core.hpp"
|
||||
#include "ngraph/ngraph.hpp"
|
||||
#include "transformations/serialize.hpp"
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
|
||||
#ifndef IR_SERIALIZATION_MODELS_PATH // should be already defined by cmake
|
||||
#define IR_SERIALIZATION_MODELS_PATH ""
|
||||
# error "IR_SERIALIZATION_MODELS_PATH is not defined"
|
||||
#endif
|
||||
|
||||
class SerializationTransformationTest : public ::testing::Test {
|
||||
|
|
@ -22,8 +23,10 @@ protected:
|
|||
std::shared_ptr<ngraph::Function> m_function;
|
||||
|
||||
void SetUp() override {
|
||||
const std::string model = IR_SERIALIZATION_MODELS_PATH "add_abc.xml";
|
||||
const std::string weights = IR_SERIALIZATION_MODELS_PATH "add_abc.bin";
|
||||
const std::string model = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc.xml");
|
||||
const std::string weights = CommonTestUtils::getModelFromTestModelZoo(
|
||||
IR_SERIALIZATION_MODELS_PATH "add_abc.bin");
|
||||
InferenceEngine::Core ie;
|
||||
m_function = ie.ReadNetwork(model, weights).getFunction();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "ie_common.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include <fstream>
|
||||
|
||||
|
|
@ -12,7 +14,7 @@ namespace {
|
|||
std::string path = ONNX_TEST_MODELS;
|
||||
path += "support_test/";
|
||||
path += model;
|
||||
return path;
|
||||
return CommonTestUtils::getModelFromTestModelZoo(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -37,13 +39,9 @@ TEST(ONNXReader_ModelSupported, varint_on_two_bytes) {
|
|||
EXPECT_NO_THROW(InferenceEngine::Core{}.ReadNetwork(model_path("supported/varint_on_two_bytes.onnx")));
|
||||
}
|
||||
|
||||
TEST(ONNXReader_ModelSupported, prototxt_basic) {
|
||||
EXPECT_NO_THROW(InferenceEngine::Core{}.ReadNetwork(model_path("supported/basic.prototxt")));
|
||||
}
|
||||
|
||||
TEST(ONNXReader_ModelSupported, scrambled_keys) {
|
||||
// same as the prototxt_basic but with a different order of keys
|
||||
EXPECT_NO_THROW(InferenceEngine::Core{}.ReadNetwork(model_path("supported/scrambled_keys.prototxt")));
|
||||
EXPECT_NO_THROW(InferenceEngine::Core{}.ReadNetwork(model_path("supported/scrambled_keys.onnx")));
|
||||
}
|
||||
|
||||
TEST(ONNXReader_ModelUnsupported, no_graph_field) {
|
||||
|
|
@ -65,8 +63,3 @@ TEST(ONNXReader_ModelUnsupported, unknown_wire_type) {
|
|||
EXPECT_THROW(InferenceEngine::Core{}.ReadNetwork(model_path("unsupported/unknown_wire_type.onnx")),
|
||||
InferenceEngine::Exception);
|
||||
}
|
||||
|
||||
TEST(ONNXReader_ModelUnsupported, no_valid_keys) {
|
||||
EXPECT_THROW(InferenceEngine::Core{}.ReadNetwork(model_path("unsupported/no_valid_keys.prototxt")),
|
||||
InferenceEngine::Exception);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
:D
|
||||
|
||||
xy"Cosh
|
||||
cosh_graphZ
|
||||
x
|
||||
|
||||
|
||||
b
|
||||
y
|
||||
|
||||
|
||||
B
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
james_bond: 007
|
||||
Shakira: "Waka Waka"
|
||||
blip {
|
||||
bloop: 21,37
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
ir_version: 3
|
||||
producer_name: "nGraph ONNX Importer"
|
||||
graph {
|
||||
node {
|
||||
input: "A"
|
||||
input: "B"
|
||||
output: "X"
|
||||
name: "multiply_node_1"
|
||||
op_type: "Mul"
|
||||
}
|
||||
node {
|
||||
input: "X"
|
||||
input: "C"
|
||||
output: "Y"
|
||||
name: "multiply_node_2"
|
||||
op_type: "Mul"
|
||||
}
|
||||
name: "test_graph"
|
||||
initializer {
|
||||
dims: 2
|
||||
dims: 2
|
||||
data_type: 1
|
||||
name: "A"
|
||||
external_data {
|
||||
key: "location",
|
||||
value: "data/tensor.data"
|
||||
}
|
||||
data_location: 1
|
||||
}
|
||||
input {
|
||||
name: "A"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "B"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "C"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "Y"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
version: 4
|
||||
}
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
// Copyright (C) 2018-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
|
||||
#include <ie_blob.h>
|
||||
#include <ie_core.hpp>
|
||||
#include <ngraph/ngraph.hpp>
|
||||
|
||||
TEST(ONNX_Reader_Tests, ImportBasicModelToCore) {
|
||||
std::string model = R"V0G0N(
|
||||
ir_version: 3
|
||||
producer_name: "nGraph ONNX Importer"
|
||||
graph {
|
||||
node {
|
||||
output: "B"
|
||||
op_type: "Constant"
|
||||
attribute {
|
||||
name: "value"
|
||||
t {
|
||||
dims: 2
|
||||
dims: 2
|
||||
data_type: 1
|
||||
float_data: 1
|
||||
float_data: 2
|
||||
float_data: 3
|
||||
float_data: 4
|
||||
name: "const_tensor"
|
||||
}
|
||||
type: TENSOR
|
||||
}
|
||||
}
|
||||
node {
|
||||
input: "A"
|
||||
input: "B"
|
||||
output: "X"
|
||||
name: "add_node1"
|
||||
op_type: "Add"
|
||||
}
|
||||
node {
|
||||
input: "X"
|
||||
input: "C"
|
||||
output: "Y"
|
||||
name: "add_node2"
|
||||
op_type: "Add"
|
||||
}
|
||||
name: "test_graph"
|
||||
initializer {
|
||||
dims: 2
|
||||
dims: 2
|
||||
data_type: 1
|
||||
name: "A"
|
||||
raw_data: "\000\000\200?\000\000\000@\000\000@@\000\000\200@"
|
||||
}
|
||||
input {
|
||||
name: "A"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "C"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "Y"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: 1
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
dim {
|
||||
dim_value: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
version: 4
|
||||
}
|
||||
)V0G0N";
|
||||
InferenceEngine::Core ie;
|
||||
InferenceEngine::Blob::CPtr weights;
|
||||
auto cnnNetwork = ie.ReadNetwork(model, weights);
|
||||
auto function = cnnNetwork.getFunction();
|
||||
|
||||
int count_additions = 0;
|
||||
int count_constants = 0;
|
||||
int count_parameters = 0;
|
||||
|
||||
for (auto op : function->get_ops()) {
|
||||
const auto op_type = std::string(op->get_type_name());
|
||||
count_additions += (op_type == "Add" ? 1 : 0);
|
||||
count_constants += (op_type == "Constant" ? 1 : 0);
|
||||
count_parameters += (op_type == "Parameter" ? 1 : 0);
|
||||
}
|
||||
|
||||
ASSERT_EQ(function->get_output_size(), 1);
|
||||
ASSERT_EQ(std::string(function->get_output_op(0)->get_type_name()), "Result");
|
||||
ASSERT_EQ(function->get_output_element_type(0), ngraph::element::f32);
|
||||
ASSERT_EQ(function->get_output_shape(0), ngraph::Shape({2, 2}));
|
||||
ASSERT_EQ(count_additions, 2);
|
||||
ASSERT_EQ(count_constants, 2);
|
||||
ASSERT_EQ(count_parameters, 1);
|
||||
}
|
||||
|
||||
|
|
@ -12,11 +12,14 @@
|
|||
#include <ie_core.hpp>
|
||||
#include <file_utils.h>
|
||||
#include <streambuf>
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "common_test_utils/unicode_utils.hpp"
|
||||
#include <ngraph/ngraph.hpp>
|
||||
|
||||
TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromFile) {
|
||||
InferenceEngine::Core ie;
|
||||
auto cnnNetwork = ie.ReadNetwork(std::string(ONNX_TEST_MODELS) + "onnx_external_data.prototxt", "");
|
||||
auto cnnNetwork = ie.ReadNetwork(CommonTestUtils::getModelFromTestModelZoo(
|
||||
std::string(ONNX_TEST_MODELS) + "onnx_external_data.onnx"), "");
|
||||
auto function = cnnNetwork.getFunction();
|
||||
|
||||
int count_additions = 0;
|
||||
|
|
@ -48,8 +51,9 @@ TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromFile) {
|
|||
|
||||
TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromStringException) {
|
||||
InferenceEngine::Core ie;
|
||||
const auto path = std::string(ONNX_TEST_MODELS) + "onnx_external_data.prototxt";
|
||||
InferenceEngine::Blob::CPtr weights; //not used
|
||||
const auto path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
std::string(ONNX_TEST_MODELS) + "onnx_external_data.onnx");
|
||||
InferenceEngine::Blob::CPtr weights; // not used
|
||||
std::ifstream stream(path, std::ios::binary);
|
||||
std::string modelAsString((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
|
||||
stream.close();
|
||||
|
|
@ -75,22 +79,28 @@ TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromStringException) {
|
|||
#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
|
||||
TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromWstringNamedFile) {
|
||||
InferenceEngine::Core ie;
|
||||
std::string win_dir_path = ONNX_TEST_MODELS;
|
||||
std::replace(win_dir_path.begin(), win_dir_path.end(), '/', '\\');
|
||||
const std::wstring unicode_win_dir_path = FileUtils::multiByteCharToWString(win_dir_path.c_str());
|
||||
const std::wstring path = unicode_win_dir_path + L"ひらがな日本語.prototxt";
|
||||
std::string win_dir_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
ONNX_TEST_MODELS "onnx_external_data.onnx");
|
||||
std::wstring wmodel = CommonTestUtils::addUnicodePostfixToPath(win_dir_path,
|
||||
CommonTestUtils::test_unicode_postfix_vector[0]);
|
||||
bool is_copy_successfully = CommonTestUtils::copyFile(win_dir_path, wmodel);
|
||||
if (!is_copy_successfully) {
|
||||
FAIL() << "Unable to copy from '" << win_dir_path << "' to '"
|
||||
<< FileUtils::wStringtoMBCSstringChar(wmodel) << "'";
|
||||
}
|
||||
|
||||
auto cnnNetwork = ie.ReadNetwork(path, L"");
|
||||
auto cnnNetwork = ie.ReadNetwork(wmodel, L"");
|
||||
CommonTestUtils::removeFile(wmodel);
|
||||
auto function = cnnNetwork.getFunction();
|
||||
|
||||
int count_multiply = 0;
|
||||
int count_add = 0;
|
||||
int count_constants = 0;
|
||||
int count_parameters = 0;
|
||||
|
||||
std::shared_ptr<ngraph::Node> external_data_node;
|
||||
for (auto op : function->get_ops()) {
|
||||
const auto op_type = std::string(op->get_type_name());
|
||||
count_multiply += (op_type == "Multiply" ? 1 : 0);
|
||||
count_add += (op_type == "Add" ? 1 : 0);
|
||||
count_parameters += (op_type == "Parameter" ? 1 : 0);
|
||||
if (op_type == "Constant") {
|
||||
count_constants += 1;
|
||||
|
|
@ -102,7 +112,7 @@ TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromWstringNamedFile) {
|
|||
ASSERT_EQ(std::string(function->get_output_op(0)->get_type_name()), "Result");
|
||||
ASSERT_EQ(function->get_output_element_type(0), ngraph::element::f32);
|
||||
ASSERT_EQ(function->get_output_shape(0), ngraph::Shape({2, 2}));
|
||||
ASSERT_EQ(count_multiply, 2);
|
||||
ASSERT_EQ(count_add, 2);
|
||||
ASSERT_EQ(count_constants, 1);
|
||||
ASSERT_EQ(count_parameters, 2);
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -13,6 +13,7 @@
|
|||
#include <ngraph/ngraph.hpp>
|
||||
#include <ngraph/opsets/opset8.hpp>
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "common_test_utils/unicode_utils.hpp"
|
||||
|
||||
TEST(PDPD_Reader_Tests, ImportBasicModelToCore) {
|
||||
auto model = std::string(PADDLE_TEST_MODELS) + "relu.pdmodel";
|
||||
|
|
@ -48,12 +49,17 @@ TEST(PDPD_Reader_Tests, ImportBasicModelToCore) {
|
|||
|
||||
#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
|
||||
TEST(PDPD_Reader_Tests, ImportBasicModelToCoreWstring) {
|
||||
std::string win_dir_path{ PADDLE_TEST_MODELS };
|
||||
std::replace(win_dir_path.begin(), win_dir_path.end(), '/', '\\');
|
||||
const std::wstring unicode_win_dir_path = FileUtils::multiByteCharToWString(win_dir_path.c_str());
|
||||
auto model = unicode_win_dir_path + L"ひらがな日本語.pdmodel";
|
||||
std::string win_dir_path{ PADDLE_TEST_MODELS "relu.pdmodel" };
|
||||
std::wstring wmodel = CommonTestUtils::addUnicodePostfixToPath(win_dir_path,
|
||||
CommonTestUtils::test_unicode_postfix_vector[0]);
|
||||
bool is_copy_successfully = CommonTestUtils::copyFile(win_dir_path, wmodel);
|
||||
if (!is_copy_successfully) {
|
||||
FAIL() << "Unable to copy from '" << win_dir_path << "' to '"
|
||||
<< FileUtils::wStringtoMBCSstringChar(wmodel) << "'";
|
||||
}
|
||||
InferenceEngine::Core ie;
|
||||
auto cnnNetwork = ie.ReadNetwork(model);
|
||||
auto cnnNetwork = ie.ReadNetwork(wmodel);
|
||||
CommonTestUtils::removeFile(wmodel);
|
||||
auto function = cnnNetwork.getFunction();
|
||||
|
||||
const auto inputType = ngraph::element::f32;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ target_link_libraries(cpuSpecificRtInfo PRIVATE ngraph)
|
|||
set(INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} ${IE_MAIN_SOURCE_DIR}/src/mkldnn_plugin)
|
||||
set(DEPENDENCIES MKLDNNPlugin AutoPlugin)
|
||||
set(LINK_LIBRARIES funcSharedTests cpuSpecificRtInfo)
|
||||
if (NGRAPH_ONNX_IMPORT_ENABLE AND NOT NGRAPH_USE_PROTOBUF_LITE)
|
||||
if (NGRAPH_ONNX_IMPORT_ENABLE)
|
||||
list(APPEND INCLUDES "${OpenVINO_SOURCE_DIR}/docs/onnx_custom_op")
|
||||
list(APPEND LINK_LIBRARIES onnx_custom_op)
|
||||
list(APPEND DEPENDENCIES template_extension onnx_custom_op)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright (C) 2018-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include <ngraph/file_util.hpp>
|
||||
#include <cstring>
|
||||
|
||||
#ifdef __APPLE__
|
||||
# include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <Windows.h>
|
||||
#else
|
||||
# include <dlfcn.h>
|
||||
# include <unistd.h>
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
namespace CommonTestUtils {
|
||||
|
||||
std::string getExecutableDirectory() {
|
||||
std::string path;
|
||||
#ifdef _WIN32
|
||||
char buffer[MAX_PATH];
|
||||
int len = GetModuleFileNameA(NULL, buffer, MAX_PATH);
|
||||
#elif defined(__APPLE__)
|
||||
Dl_info info;
|
||||
dladdr(reinterpret_cast<void*>(getExecutableDirectory), &info);
|
||||
const char * buffer = info.dli_fname;
|
||||
int len = std::strlen(buffer);
|
||||
#else
|
||||
char buffer[PATH_MAX];
|
||||
int len = readlink("/proc/self/exe", buffer, PATH_MAX);
|
||||
#endif
|
||||
if (len < 0) {
|
||||
throw "Can't get test executable path name";
|
||||
}
|
||||
path = std::string(buffer, len);
|
||||
return ngraph::file_util::get_directory(path);
|
||||
}
|
||||
|
||||
std::string getModelFromTestModelZoo(const std::string & relModelPath) {
|
||||
return ngraph::file_util::path_join(CommonTestUtils::getExecutableDirectory(), relModelPath);
|
||||
}
|
||||
|
||||
} // namespace CommonTestUtils
|
||||
|
|
@ -239,4 +239,9 @@ inline std::vector<std::string> splitStringByDelimiter(std::string paths, const
|
|||
splitPath.push_back(paths);
|
||||
return splitPath;
|
||||
}
|
||||
|
||||
std::string getExecutableDirectory();
|
||||
|
||||
std::string getModelFromTestModelZoo(const std::string & relModelPath);
|
||||
|
||||
} // namespace CommonTestUtils
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "w_dirent.h"
|
||||
|
||||
#ifdef ENABLE_UNICODE_PATH_SUPPORT
|
||||
|
||||
namespace CommonTestUtils {
|
||||
|
||||
inline void fixSlashes(std::string &str) {
|
||||
|
|
@ -55,11 +56,12 @@ inline bool copyFile(std::string source_path, std::wstring dest_path) {
|
|||
|
||||
inline std::wstring addUnicodePostfixToPath(std::string source_path, std::wstring postfix) {
|
||||
fixSlashes(source_path);
|
||||
std::wstring result = stringToWString(source_path);
|
||||
std::wstring file_name = result.substr(0, result.size() - 4);
|
||||
std::wstring extension = result.substr(result.size() - 4, result.size());
|
||||
result = file_name + postfix + extension;
|
||||
return result;
|
||||
auto result = stringToWString(source_path);
|
||||
auto extPos = result.rfind('.');
|
||||
auto extension = result.substr(extPos, result.size());
|
||||
auto file_name = result.substr(0, extPos);
|
||||
|
||||
return file_name + postfix + extension;
|
||||
}
|
||||
|
||||
inline void removeFile(std::wstring path) {
|
||||
|
|
|
|||
|
|
@ -2,20 +2,21 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
if (NOT NGRAPH_USE_PROTOBUF_LITE)
|
||||
set(TARGET_NAME onnxImporterUnitTests)
|
||||
set(TARGET_NAME onnxImporterUnitTests)
|
||||
|
||||
addIeTargetTest(
|
||||
NAME ${TARGET_NAME}
|
||||
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
LINK_LIBRARIES
|
||||
gtest
|
||||
gtest_main
|
||||
onnx_importer
|
||||
DEFINES
|
||||
ONNX_MODELS_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/models\"
|
||||
ADD_CPPLINT
|
||||
LABELS
|
||||
ONNX
|
||||
)
|
||||
endif()
|
||||
addIeTargetTest(
|
||||
NAME ${TARGET_NAME}
|
||||
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
LINK_LIBRARIES
|
||||
gtest
|
||||
gtest_main
|
||||
commonTestUtils
|
||||
onnx_importer
|
||||
DEFINES
|
||||
ONNX_MODELS_DIR=\"${TEST_MODEL_ZOO}/onnx_import\"
|
||||
ADD_CPPLINT
|
||||
DEPENDENCIES
|
||||
test_model_zoo
|
||||
LABELS
|
||||
ONNX
|
||||
)
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@
|
|||
#include <string>
|
||||
#include <fstream>
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "ngraph/file_util.hpp"
|
||||
#include "onnx_import/onnx.hpp"
|
||||
|
||||
TEST(ONNX_Importer_Tests, ImportBasicModel) {
|
||||
auto model_file_path = ngraph::file_util::path_join(ONNX_MODELS_DIR, "add_abc_initializers.prototxt");
|
||||
auto model_file_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
ngraph::file_util::path_join(ONNX_MODELS_DIR, "add_abc_initializers.onnx"));
|
||||
auto function = ngraph::onnx_import::import_onnx_model(model_file_path);
|
||||
|
||||
int count_additions = 0;
|
||||
|
|
@ -35,7 +37,8 @@ TEST(ONNX_Importer_Tests, ImportBasicModel) {
|
|||
}
|
||||
|
||||
TEST(ONNX_Importer_Tests, ImportModelWithFusedOp) {
|
||||
auto model_file_path = ngraph::file_util::path_join(ONNX_MODELS_DIR, "selu.prototxt");
|
||||
auto model_file_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
ngraph::file_util::path_join(ONNX_MODELS_DIR, "selu.onnx"));
|
||||
auto function = ngraph::onnx_import::import_onnx_model(model_file_path);
|
||||
|
||||
int count_selu = 0;
|
||||
|
|
@ -59,7 +62,8 @@ TEST(ONNX_Importer_Tests, ImportModelWithFusedOp) {
|
|||
}
|
||||
|
||||
TEST(ONNX_Importer_Tests, ImportModelWithMultiOutput) {
|
||||
auto model_file_path = ngraph::file_util::path_join(ONNX_MODELS_DIR, "topk.prototxt");
|
||||
auto model_file_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
ngraph::file_util::path_join(ONNX_MODELS_DIR, "topk.onnx"));
|
||||
auto function = ngraph::onnx_import::import_onnx_model(model_file_path);
|
||||
|
||||
int count_topk = 0;
|
||||
|
|
@ -86,7 +90,8 @@ TEST(ONNX_Importer_Tests, ImportModelWithMultiOutput) {
|
|||
}
|
||||
|
||||
TEST(ONNX_Importer_Tests, ImportModelWithNotSupportedOp) {
|
||||
auto model_file_path = ngraph::file_util::path_join(ONNX_MODELS_DIR, "not_supported.prototxt");
|
||||
auto model_file_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
ngraph::file_util::path_join(ONNX_MODELS_DIR, "not_supported.onnx"));
|
||||
try {
|
||||
auto function = ngraph::onnx_import::import_onnx_model(model_file_path);
|
||||
FAIL() << "Any expection was thrown despite the ONNX model is not supported";
|
||||
|
|
@ -100,7 +105,8 @@ TEST(ONNX_Importer_Tests, ImportModelWithNotSupportedOp) {
|
|||
}
|
||||
|
||||
TEST(ONNX_Importer_Tests, ImportModelWhenFileDoesNotExist) {
|
||||
auto model_file_path = ngraph::file_util::path_join(ONNX_MODELS_DIR, "not_exist_file.prototxt");
|
||||
auto model_file_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
ngraph::file_util::path_join(ONNX_MODELS_DIR, "not_exist_file.onnx"));
|
||||
try {
|
||||
auto function = ngraph::onnx_import::import_onnx_model(model_file_path);
|
||||
FAIL() << "Any expection was thrown despite the ONNX model file does not exist";
|
||||
|
|
@ -113,26 +119,26 @@ TEST(ONNX_Importer_Tests, ImportModelWhenFileDoesNotExist) {
|
|||
}
|
||||
}
|
||||
|
||||
TEST(ONNX_Importer_Tests, ImportModelFromStream) {
|
||||
auto model_file_path = ngraph::file_util::path_join(ONNX_MODELS_DIR, "addmul_abc.prototxt");
|
||||
// TODO: CVS-61224
|
||||
TEST(ONNX_Importer_Tests, DISABLED_ImportModelFromStream) {
|
||||
auto model_file_path = CommonTestUtils::getModelFromTestModelZoo(
|
||||
ngraph::file_util::path_join(ONNX_MODELS_DIR, "addmul_abc.onnx"));
|
||||
std::ifstream model_file_stream(model_file_path);
|
||||
if (model_file_stream.is_open()) {
|
||||
int count_adds = 0;
|
||||
int count_multiplies = 0;
|
||||
int count_parameters = 0;
|
||||
ASSERT_TRUE(model_file_stream.is_open());
|
||||
int count_adds = 0;
|
||||
int count_multiplies = 0;
|
||||
int count_parameters = 0;
|
||||
|
||||
auto function = ngraph::onnx_import::import_onnx_model(model_file_stream);
|
||||
for (auto op : function->get_ops()) {
|
||||
auto function = ngraph::onnx_import::import_onnx_model(model_file_stream);
|
||||
for (auto op : function->get_ops()) {
|
||||
const auto op_type = std::string(op->get_type_name());
|
||||
count_adds += (op_type == "Add" ? 1 : 0);
|
||||
count_multiplies += (op_type == "Multiply" ? 1 : 0);
|
||||
count_parameters += (op_type == "Parameter" ? 1 : 0);
|
||||
}
|
||||
ASSERT_EQ(count_adds, 1);
|
||||
ASSERT_EQ(count_multiplies, 1);
|
||||
ASSERT_EQ(count_parameters, 3);
|
||||
count_adds += (op_type == "Add" ? 1 : 0);
|
||||
count_multiplies += (op_type == "Multiply" ? 1 : 0);
|
||||
count_parameters += (op_type == "Parameter" ? 1 : 0);
|
||||
}
|
||||
model_file_stream.close();
|
||||
ASSERT_EQ(count_adds, 1);
|
||||
ASSERT_EQ(count_multiplies, 1);
|
||||
ASSERT_EQ(count_parameters, 3);
|
||||
}
|
||||
|
||||
TEST(ONNX_Importer_Tests, GetSupportedOperators) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ target_include_directories(${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${ONNX_COMMON
|
|||
$<INSTALL_INTERFACE:${FRONTEND_INSTALL_INCLUDE}>)
|
||||
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ngraph)
|
||||
link_system_libraries(${TARGET_NAME} PUBLIC onnx_proto onnx ${Protobuf_LIBRARIES})
|
||||
link_system_libraries(${TARGET_NAME} PUBLIC onnx_proto onnx ${Protobuf_LITE_LIBRARIES})
|
||||
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${ONNX_COMMON_SRC_DIR})
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
add_definitions("-DSERIALIZED_ZOO=\"${CMAKE_CURRENT_SOURCE_DIR}/models\"")
|
||||
add_definitions(-DSERIALIZED_ZOO=\"${TEST_MODEL_ZOO}/ngraph/models\")
|
||||
set(NGRAPH_ONNX_NAMESPACE ngraph_onnx)
|
||||
|
||||
add_subdirectory(runtime)
|
||||
|
|
@ -374,7 +374,7 @@ if (NGRAPH_UNIT_TEST_BACKENDS_ENABLE)
|
|||
set(ACTIVE_BACKEND_LIST ${ACTIVE_BACKEND_LIST} INTERPRETER)
|
||||
endif()
|
||||
|
||||
add_definitions("-DTEST_FILES=\"${CMAKE_CURRENT_SOURCE_DIR}/files\"")
|
||||
add_definitions("-DTEST_FILES=\"${TEST_MODEL_ZOO}/ngraph/files\"")
|
||||
add_subdirectory(util)
|
||||
|
||||
# backend specific test files must meet the following requirements:
|
||||
|
|
@ -530,7 +530,7 @@ set(MULTI_TEST_SRC
|
|||
backend/zero_sized.in.cpp
|
||||
)
|
||||
|
||||
if (NGRAPH_ONNX_IMPORT_ENABLE AND NOT NGRAPH_USE_PROTOBUF_LITE)
|
||||
if (NGRAPH_ONNX_IMPORT_ENABLE)
|
||||
list(APPEND MULTI_TEST_SRC
|
||||
onnx/onnx_import.in.cpp
|
||||
onnx/onnx_import_controlflow.in.cpp
|
||||
|
|
@ -621,7 +621,7 @@ target_link_libraries(unit-test PRIVATE ngraph_test_util
|
|||
|
||||
# Protobuf-lite does not support parsing files from prototxt format
|
||||
# Since most of the onnx models are stored in this format it have to be disabled
|
||||
if (NGRAPH_ONNX_IMPORT_ENABLE AND NOT NGRAPH_USE_PROTOBUF_LITE)
|
||||
if (NGRAPH_ONNX_IMPORT_ENABLE)
|
||||
# It's needed by onnx_import_library.cpp and onnx_import_exceptions.cpp tests to include onnx_pb.h.
|
||||
# Not linking statically to libprotobuf (linked into libonnx) avoids false-failing onnx_editor tests.
|
||||
target_include_directories(unit-test
|
||||
|
|
@ -682,3 +682,6 @@ if (NGRAPH_PDPD_FRONTEND_ENABLE AND paddlepaddle_FOUND)
|
|||
COMPONENT tests
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# process models
|
||||
add_dependencies(unit-test test_model_zoo)
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#include <frontend_manager/frontend_manager.hpp>
|
||||
|
||||
#include "common_test_utils/ngraph_test_utils.hpp"
|
||||
#include "utils.hpp"
|
||||
#include "paddle_utils.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
using namespace ngraph;
|
||||
using namespace ngraph::frontend;
|
||||
|
|
@ -32,9 +32,12 @@ TEST(FrontEndConvertModelTest, test_unsupported_op)
|
|||
ASSERT_NO_THROW(function = frontEnd->convert_partially(inputModel));
|
||||
ASSERT_THROW(frontEnd->convert(function), OpConversionFailure);
|
||||
|
||||
for (auto& node : function->get_ordered_ops()) {
|
||||
if (node->get_friendly_name() == "rxyz_0.tmp_0") {
|
||||
function->replace_node(node, std::make_shared<opset6::Relu>(node->input(0).get_source_output()));
|
||||
for (auto& node : function->get_ordered_ops())
|
||||
{
|
||||
if (node->get_friendly_name() == "rxyz_0.tmp_0")
|
||||
{
|
||||
function->replace_node(
|
||||
node, std::make_shared<opset6::Relu>(node->input(0).get_source_output()));
|
||||
}
|
||||
}
|
||||
ASSERT_NO_THROW(frontEnd->convert(function));
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
ngraph ONNXImporter:†
|
||||
|
||||
A
|
||||
BX add_node1"Add
|
||||
|
||||
X
|
||||
CY add_node2"Add
|
||||
test_graphZ
|
||||
A
|
||||
|
||||
|
||||
Z
|
||||
B
|
||||
|
||||
|
||||
Z
|
||||
C
|
||||
|
||||
|
||||
b
|
||||
Y
|
||||
|
||||
|
||||
B
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
ir_version: 3
|
||||
producer_name: "nGraph ONNX Importer"
|
||||
graph {
|
||||
node {
|
||||
input: "cond"
|
||||
output: "cond_bool"
|
||||
op_type: "Cast"
|
||||
attribute {
|
||||
name: "to"
|
||||
i: 9
|
||||
type: INT
|
||||
}
|
||||
}
|
||||
node {
|
||||
input: "cond_bool"
|
||||
input: "x1"
|
||||
input: "x2"
|
||||
output: "y"
|
||||
op_type: "Where"
|
||||
}
|
||||
name: "where_graph"
|
||||
input {
|
||||
name: "cond"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: INT32
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "x1"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: INT32
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
input {
|
||||
name: "x2"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: INT32
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
name: "y"
|
||||
type {
|
||||
tensor_type {
|
||||
elem_type: INT32
|
||||
shape {
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
dim {
|
||||
dim_value: 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
opset_import {
|
||||
version: 9
|
||||
}
|
||||
|
|
@ -24,6 +24,7 @@ Options:
|
|||
from docopt import docopt
|
||||
from google.protobuf import text_format
|
||||
import onnx
|
||||
from onnx.external_data_helper import convert_model_to_external_data
|
||||
import os
|
||||
|
||||
ONNX_SUFFX = '.onnx'
|
||||
|
|
@ -53,6 +54,18 @@ _ext_map = {
|
|||
def _get_output_file_path(path, extension):
|
||||
return path + _ext_map[extension]
|
||||
|
||||
|
||||
def save_model(proto, f, format=None, save_as_external_data=False, all_tensors_to_one_file=True, location=None, size_threshold=1024, convert_attribute=False):
|
||||
if isinstance(proto, bytes):
|
||||
proto = onnx._deserialize(proto, onnx.ModelProto())
|
||||
|
||||
if save_as_external_data:
|
||||
convert_model_to_external_data(proto, all_tensors_to_one_file, location, size_threshold, convert_attribute)
|
||||
|
||||
s = onnx._serialize(proto)
|
||||
onnx._save_bytes(s, f)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = docopt(__doc__)
|
||||
input_file_path = args['INPUT_FILE']
|
||||
|
|
@ -61,8 +74,6 @@ if __name__ == '__main__':
|
|||
else:
|
||||
output_file_path = args['OUTPUT_FILE']
|
||||
|
||||
print('Converting {} to {}.'.format(input_file_path, output_file_path))
|
||||
|
||||
if not os.path.exists(input_file_path):
|
||||
sys.exit('ERROR: Provided input model path does not exists: {}'.format(input_file_path))
|
||||
|
||||
|
|
@ -75,6 +86,6 @@ if __name__ == '__main__':
|
|||
elif _is_txt_file(input_file_path) and _is_bin_file(output_file_path):
|
||||
with open(input_file_path, 'r') as f:
|
||||
converted_model = _txt2bin(f.read())
|
||||
onnx.save(converted_model, output_file_path)
|
||||
save_model(converted_model, output_file_path)
|
||||
else:
|
||||
sys.exit('ERROR: Provided input or output file has unsupported format.')
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ NGRAPH_TEST(onnx_editor, types__single_input_type_substitution)
|
|||
{
|
||||
// the original model contains 2 inputs with i64 data type and one f32 input
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_abc.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_abc.onnx")};
|
||||
|
||||
editor.set_input_types({{"A", element::i64}});
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ NGRAPH_TEST(onnx_editor, types__all_inputs_type_substitution)
|
|||
{
|
||||
// the original model contains 2 inputs with i64 data type and one f32 input
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_abc.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_abc.onnx")};
|
||||
|
||||
editor.set_input_types({{"A", element::i8}, {"B", element::i8}, {"C", element::i8}});
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ NGRAPH_TEST(onnx_editor, types__all_inputs_type_substitution)
|
|||
NGRAPH_TEST(onnx_editor, types__missing_type_in_input_descriptor)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/invalid_input_no_type.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/invalid_input_no_type.onnx")};
|
||||
|
||||
// input A doesn't have the "type" field in the model and so the data type cannot be modified
|
||||
EXPECT_THROW(editor.set_input_types({{"A", element::f32}}), ngraph_error);
|
||||
|
|
@ -107,7 +107,7 @@ NGRAPH_TEST(onnx_editor, types__missing_type_in_input_descriptor)
|
|||
NGRAPH_TEST(onnx_editor, types__missing_tensor_type_in_input_descriptor)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/invalid_input_no_tensor_type.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/invalid_input_no_tensor_type.onnx")};
|
||||
|
||||
// input A doesn't have the "tensor_type" field in the model
|
||||
EXPECT_THROW(editor.set_input_types({{"A", element::f32}}), ngraph_error);
|
||||
|
|
@ -116,7 +116,7 @@ NGRAPH_TEST(onnx_editor, types__missing_tensor_type_in_input_descriptor)
|
|||
NGRAPH_TEST(onnx_editor, types__unsupported_data_type_passed)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_abc.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_abc.onnx")};
|
||||
|
||||
EXPECT_THROW(editor.set_input_types({{"A", element::dynamic}}), ngraph_error);
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ NGRAPH_TEST(onnx_editor, types__unsupported_data_type_passed)
|
|||
NGRAPH_TEST(onnx_editor, types__incorrect_input_name_passed)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_abc.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_abc.onnx")};
|
||||
|
||||
EXPECT_THROW(editor.set_input_types({{"ShiaLaBeouf", element::i64}}), ngraph_error);
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ NGRAPH_TEST(onnx_editor, types__elem_type_missing_in_input)
|
|||
{
|
||||
// the original model contains 2 inputs with i64 data type and one f32 input
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/elem_type_missing_in_input.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/elem_type_missing_in_input.onnx")};
|
||||
|
||||
// the "elem_type" is missing in the model but it should be possible to set the type anyway
|
||||
EXPECT_NO_THROW(editor.set_input_types({{"A", element::i64}}));
|
||||
|
|
@ -154,7 +154,7 @@ NGRAPH_TEST(onnx_editor, types__elem_type_missing_in_input)
|
|||
NGRAPH_TEST(onnx_editor, shapes__modify_single_input)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.onnx")};
|
||||
|
||||
const auto new_shape = PartialShape{1};
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ NGRAPH_TEST(onnx_editor, shapes__modify_single_input)
|
|||
NGRAPH_TEST(onnx_editor, shapes__modify_all_inputs)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.onnx")};
|
||||
|
||||
const auto new_shape = PartialShape{1, 2, 3, 5, 8, 13};
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ NGRAPH_TEST(onnx_editor, shapes__modify_all_inputs)
|
|||
NGRAPH_TEST(onnx_editor, shapes__dynamic_rank_in_model)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/shapes__dynamic_rank_in_model.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/shapes__dynamic_rank_in_model.onnx")};
|
||||
|
||||
// input A in the model doesn't have the "shape" field meaning it has dynamic rank
|
||||
// it should still be possible to set such input's shape to some custom value
|
||||
|
|
@ -204,7 +204,7 @@ NGRAPH_TEST(onnx_editor, shapes__dynamic_rank_in_model)
|
|||
NGRAPH_TEST(onnx_editor, shapes__set_dynamic_dimension)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.onnx")};
|
||||
|
||||
const auto new_shape = PartialShape{Dimension::dynamic()};
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ NGRAPH_TEST(onnx_editor, shapes__set_dynamic_dimension)
|
|||
NGRAPH_TEST(onnx_editor, shapes__set_mixed_dimensions)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.onnx")};
|
||||
|
||||
const auto new_shape_A = PartialShape{21, Dimension::dynamic()};
|
||||
const auto new_shape_B = PartialShape{Dimension::dynamic(), 37};
|
||||
|
|
@ -239,7 +239,7 @@ NGRAPH_TEST(onnx_editor, shapes__set_mixed_dimensions)
|
|||
NGRAPH_TEST(onnx_editor, shapes__set_scalar_inputs)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.onnx")};
|
||||
|
||||
const auto new_shape = PartialShape{};
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ NGRAPH_TEST(onnx_editor, shapes__set_scalar_inputs)
|
|||
NGRAPH_TEST(onnx_editor, shapes__static_to_dynamic_rank_substitution)
|
||||
{
|
||||
ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/shapes__add_two_inputs.onnx")};
|
||||
|
||||
const auto new_shape = PartialShape::dynamic();
|
||||
|
||||
|
|
@ -277,12 +277,12 @@ NGRAPH_TEST(onnx_editor, shapes__static_to_dynamic_rank_substitution)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__linear_model_head_cut)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge(1, 0)}}, {});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_head_cut.prototxt");
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_head_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -292,14 +292,14 @@ NGRAPH_TEST(onnx_editor, subgraph__linear_model_head_cut)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__linear_model_head_cut_ins_and_outs)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge(1, 0)}},
|
||||
{{OutputEdge(2, 0)}});
|
||||
|
||||
// expected to behave the same way as subgraph__linear_model_head_cut
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_head_cut.prototxt");
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_head_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -309,13 +309,13 @@ NGRAPH_TEST(onnx_editor, subgraph__linear_model_head_cut_ins_and_outs)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__linear_model_deeper_head_cut)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge(2, 0)}}, {});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/subgraph__linear_model_deeper_head_cut.prototxt");
|
||||
"onnx/model_editor/reference/subgraph__linear_model_deeper_head_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -325,12 +325,12 @@ NGRAPH_TEST(onnx_editor, subgraph__linear_model_deeper_head_cut)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__linear_model_tail_cut)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({}, {{OutputEdge{1, 0}}});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_tail_cut.prototxt");
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_tail_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -340,13 +340,13 @@ NGRAPH_TEST(onnx_editor, subgraph__linear_model_tail_cut)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__linear_model_tail_cut_ins_and_outs)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{0, 0}}}, {{OutputEdge{1, 0}}});
|
||||
|
||||
// expected to behave the same way as subgraph__linear_model_tail_cut
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_tail_cut.prototxt");
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_tail_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -356,13 +356,13 @@ NGRAPH_TEST(onnx_editor, subgraph__linear_model_tail_cut_ins_and_outs)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__linear_model_with_initializer_tail_cut)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head_with_initializer.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head_with_initializer.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({}, {{OutputEdge{1, 0}}});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/subgraph__linear_model_with_initializer_tail_cut.prototxt");
|
||||
"onnx/model_editor/reference/subgraph__linear_model_with_initializer_tail_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -372,14 +372,14 @@ NGRAPH_TEST(onnx_editor, subgraph__linear_model_with_initializer_tail_cut)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__initializer_without_matching_input_tail_cut)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__initializer_without_matching_input.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__initializer_without_matching_input.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({}, {{OutputEdge{1, 0}}});
|
||||
|
||||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__initializer_without_matching_input_tail_cut.prototxt");
|
||||
"subgraph__initializer_without_matching_input_tail_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -389,13 +389,13 @@ NGRAPH_TEST(onnx_editor, subgraph__initializer_without_matching_input_tail_cut)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__linear_model_deeper_tail_cut)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({}, {{OutputEdge{0, 0}}});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/subgraph__linear_model_deeper_tail_cut.prototxt");
|
||||
"onnx/model_editor/reference/subgraph__linear_model_deeper_tail_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -405,7 +405,7 @@ NGRAPH_TEST(onnx_editor, subgraph__linear_model_deeper_tail_cut)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__no_input_params)
|
||||
{
|
||||
const auto model_path =
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt");
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx");
|
||||
|
||||
ONNXModelEditor editor{model_path};
|
||||
|
||||
|
|
@ -419,14 +419,14 @@ NGRAPH_TEST(onnx_editor, subgraph__no_input_params)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__initializer_to_input_replacement)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head_with_initializer.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head_with_initializer.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{0, 2}}},
|
||||
{{OutputEdge{0, 0}}});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/subgraph__initializer_to_input_replacement.prototxt");
|
||||
"onnx/model_editor/reference/subgraph__initializer_to_input_replacement.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -436,14 +436,14 @@ NGRAPH_TEST(onnx_editor, subgraph__initializer_to_input_replacement)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__initializer_to_input_replacement_2)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__initializer_without_matching_input.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__initializer_without_matching_input.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{0, 2}}},
|
||||
{{OutputEdge{0, 0}}});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/subgraph__initializer_to_input_replacement.prototxt");
|
||||
"onnx/model_editor/reference/subgraph__initializer_to_input_replacement.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -453,12 +453,12 @@ NGRAPH_TEST(onnx_editor, subgraph__initializer_to_input_replacement_2)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__multiout_op_output_edge)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({}, {{OutputEdge{5, 1}}});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__multiout_op_output_edge.prototxt");
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__multiout_op_output_edge.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -468,7 +468,7 @@ NGRAPH_TEST(onnx_editor, subgraph__multiout_op_output_edge)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__existing_inputs_and_outputs_based_extraction)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{1, 1}, InputEdge{2, 0}}},
|
||||
{{OutputEdge{4, 0}}});
|
||||
|
|
@ -476,7 +476,7 @@ NGRAPH_TEST(onnx_editor, subgraph__existing_inputs_and_outputs_based_extraction)
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__existing_inputs_and_outputs_based_extraction.prototxt");
|
||||
"subgraph__existing_inputs_and_outputs_based_extraction.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -486,14 +486,14 @@ NGRAPH_TEST(onnx_editor, subgraph__existing_inputs_and_outputs_based_extraction)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__twice_input_edge_from_tensor_with_single_consumer)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_ab.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_ab.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({InputEdge{1, 1}}, {});
|
||||
|
||||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__twice_input_edge_from_tensor_with_single_consumer.prototxt");
|
||||
"subgraph__twice_input_edge_from_tensor_with_single_consumer.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -503,7 +503,7 @@ NGRAPH_TEST(onnx_editor, subgraph__twice_input_edge_from_tensor_with_single_cons
|
|||
NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumers)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{1, 0}, InputEdge{6, 0}}},
|
||||
{{OutputEdge{6, 0}, OutputEdge{4, 0}}});
|
||||
|
|
@ -511,7 +511,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers.prototxt");
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -521,7 +521,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumers_2)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{3, 0}, InputEdge{3, 1}}},
|
||||
{{OutputEdge{3, 0}, OutputEdge{4, 0}}});
|
||||
|
|
@ -529,7 +529,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_2.prototxt");
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_2.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -539,7 +539,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumers_3)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{3, 0}, InputEdge{6, 0}}},
|
||||
{{OutputEdge{6, 0}, OutputEdge{5, 1}}});
|
||||
|
|
@ -547,7 +547,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_3.prototxt");
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_3.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -557,14 +557,14 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumers_4)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{1, 0}, InputEdge{3, 0}}}, {});
|
||||
|
||||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_4.prototxt");
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_4.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -574,7 +574,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumers_5)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({InputEdge{3, 0}},
|
||||
{{OutputEdge{6,0}, OutputEdge{5, 1}}});
|
||||
|
|
@ -583,7 +583,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_5.prototxt");
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_5.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -593,7 +593,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumers_custom_names)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{1, 0, "new_name_1"}, InputEdge{6, 0, "new_name_2"}}},
|
||||
{{OutputEdge{6, 0}, OutputEdge{4, 0}}});
|
||||
|
|
@ -601,7 +601,7 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_custom_names.prototxt");
|
||||
"subgraph__input_edge_from_tensor_with_multiple_consumers_custom_names.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -611,14 +611,14 @@ NGRAPH_TEST(onnx_editor, subgraph__input_edge_from_tensor_with_multiple_consumer
|
|||
NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_input_relu2)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{4, 0}}}, {});
|
||||
|
||||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__multiple_consumers_of_graph_input_relu2.prototxt");
|
||||
"subgraph__multiple_consumers_of_graph_input_relu2.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -628,14 +628,14 @@ NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_input_relu2)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_initializer)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{2, 0}}}, {});
|
||||
|
||||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__multiple_consumers_of_graph_initializer.prototxt");
|
||||
"subgraph__multiple_consumers_of_graph_initializer.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -645,7 +645,7 @@ NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_initializer)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_initializer_2)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{2, 0}, InputEdge{3, 0}}}, {});
|
||||
|
||||
|
|
@ -653,7 +653,7 @@ NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_initializer_2)
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__multiple_consumers_of_graph_initializer.prototxt");
|
||||
"subgraph__multiple_consumers_of_graph_initializer.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -663,14 +663,14 @@ NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_initializer_2)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_initializer_relu2_and_init)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{5, 0}, InputEdge{3, 0}}}, {});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__multiple_consumers_of_graph_initializer_relu2_and_init.prototxt");
|
||||
"subgraph__multiple_consumers_of_graph_initializer_relu2_and_init.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -680,7 +680,7 @@ NGRAPH_TEST(onnx_editor, subgraph__multiple_consumers_of_graph_initializer_relu2
|
|||
NGRAPH_TEST(onnx_editor, subgraph__invalid_edge_idx)
|
||||
{
|
||||
const auto model_path =
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt");
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx");
|
||||
|
||||
ONNXModelEditor editor{model_path};
|
||||
try
|
||||
|
|
@ -699,7 +699,7 @@ NGRAPH_TEST(onnx_editor, subgraph__invalid_edge_idx)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__invalid_port_idx)
|
||||
{
|
||||
const auto model_path =
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt");
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx");
|
||||
|
||||
ONNXModelEditor editor{model_path};
|
||||
try
|
||||
|
|
@ -718,7 +718,7 @@ NGRAPH_TEST(onnx_editor, subgraph__invalid_port_idx)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__inputs_getter)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
EXPECT_EQ(editor.model_inputs(),
|
||||
(std::vector<std::string>{"data_0", "conv1/7x7_s2_w_0", "conv1/7x7_s2_b_0"}));
|
||||
|
|
@ -731,7 +731,7 @@ NGRAPH_TEST(onnx_editor, subgraph__inputs_getter)
|
|||
NGRAPH_TEST(onnx_editor, subgraph__custom_input_name_already_exist)
|
||||
{
|
||||
const auto model_path =
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt");
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx");
|
||||
|
||||
ONNXModelEditor editor{model_path};
|
||||
try
|
||||
|
|
@ -752,7 +752,7 @@ NGRAPH_TEST(onnx_editor, subgraph__custom_input_name_already_exist)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_output_name_and_input_name)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
const InputEdge edge = editor.find_input_edge(EditorNode{EditorOutput{"conv1/7x7_s2_2"}},
|
||||
EditorInput{"conv1/7x7_s2_1"});
|
||||
|
|
@ -768,7 +768,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_output_name_and_input_n
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_output_name_and_input_index)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
const InputEdge edge =
|
||||
editor.find_input_edge(EditorNode{EditorOutput{"conv1/7x7_s2_2"}}, EditorInput{0});
|
||||
|
|
@ -789,7 +789,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_output_name_and_input_i
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_node_name_and_input_name)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
const InputEdge edge =
|
||||
editor.find_input_edge(EditorNode{"relu1"}, EditorInput{"conv1/7x7_s2_1"});
|
||||
|
|
@ -805,7 +805,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_node_name_and_input_nam
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_node_name_and_input_index)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const InputEdge edge = editor.find_input_edge(EditorNode{"relu1_name"}, EditorInput{0});
|
||||
EXPECT_EQ(edge.m_node_idx, 0);
|
||||
|
|
@ -819,7 +819,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_node_name_and_input_ind
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_node_name_and_input_index_custom_name)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const InputEdge edge = editor.find_input_edge(EditorNode{"relu1_name"}, EditorInput{0, "custom_input_name_1"});
|
||||
EXPECT_EQ(edge.m_node_idx, 0);
|
||||
|
|
@ -835,7 +835,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_node_name_and_input_ind
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_empty_node_name)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -854,7 +854,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_empty_node_name)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_output_name)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const OutputEdge edge =
|
||||
editor.find_output_edge(EditorNode{EditorOutput{"mul2"}}, EditorOutput{"mul2"});
|
||||
|
|
@ -881,7 +881,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_output_name)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_output_name_and_output_index)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const OutputEdge edge =
|
||||
editor.find_output_edge(EditorNode{EditorOutput{"add2"}}, EditorOutput{0});
|
||||
|
|
@ -902,7 +902,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_output_name_and_output
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_node_name_and_output_name)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const OutputEdge edge =
|
||||
editor.find_output_edge(EditorNode{"relu1_name"}, EditorOutput{"relu1"});
|
||||
|
|
@ -918,7 +918,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_node_name_and_output_n
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_node_name_and_output_index)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const OutputEdge edge = editor.find_output_edge(EditorNode{"relu1_name"}, EditorOutput{0});
|
||||
EXPECT_EQ(edge.m_node_idx, 0);
|
||||
|
|
@ -932,7 +932,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_node_name_and_output_i
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_edge_const_network)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.onnx")};
|
||||
|
||||
const InputEdge edge =
|
||||
editor.find_input_edge(EditorNode{EditorOutput{"relu4"}}, EditorInput{0});
|
||||
|
|
@ -951,7 +951,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_edge_const_network)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_edge_error_handling)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.onnx")};
|
||||
|
||||
// node with given output name not found
|
||||
try
|
||||
|
|
@ -1032,7 +1032,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_edge_error_handling)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_ambiguous_node_name_but_matched_input)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
InputEdge edge = editor.find_input_edge(EditorNode{"add_ambiguous_name"}, EditorInput{"in2"});
|
||||
EXPECT_EQ(edge.m_node_idx, 1);
|
||||
|
|
@ -1046,7 +1046,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_ambiguous_node_name_but
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_ambiguous_node_name_and_not_matched_input)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -1074,7 +1074,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_ambiguous_node_name_and
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_ambiguous_node_name_and_input_index)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -1091,7 +1091,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_input_edge_by_ambiguous_node_name_and
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_ambiguous_node_name_but_matched_output)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const OutputEdge edge = editor.find_output_edge(EditorNode{"add_ambiguous_name"}, EditorOutput{"add1"});
|
||||
EXPECT_EQ(edge.m_node_idx, 1);
|
||||
|
|
@ -1105,7 +1105,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_ambiguous_node_name_bu
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_the_same_node_name_and_output_name)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests_2.onnx")};
|
||||
|
||||
const OutputEdge edge = editor.find_output_edge(EditorNode{"add1"}, EditorOutput{0});
|
||||
EXPECT_EQ(edge.m_node_idx, 0);
|
||||
|
|
@ -1119,7 +1119,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_the_same_node_name_and
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_ambiguous_node_name_and_not_matched_output)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -1136,7 +1136,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_ambiguous_node_name_an
|
|||
NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_ambiguous_node_name_and_output_index)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -1153,7 +1153,7 @@ NGRAPH_TEST(onnx_editor, editor_api_select_output_edge_by_ambiguous_node_name_an
|
|||
NGRAPH_TEST(onnx_editor, editor_api_use_edge_mapper_with_graph_cutter)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
// InputEdge{1, "in2"}
|
||||
const auto input_edge_1 = editor.find_input_edge(
|
||||
|
|
@ -1171,7 +1171,7 @@ NGRAPH_TEST(onnx_editor, editor_api_use_edge_mapper_with_graph_cutter)
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__existing_inputs_and_outputs_based_extraction.prototxt");
|
||||
"subgraph__existing_inputs_and_outputs_based_extraction.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -1196,7 +1196,7 @@ NGRAPH_TEST(onnx_editor, editor_api_use_edge_mapper_with_graph_cutter)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_use_edge_mapper_with_graph_cutter_custom_names)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const auto input_edge_1 = editor.find_input_edge(
|
||||
EditorNode{EditorOutput{"mul2"}}, EditorInput{1, "new_name_1"});
|
||||
|
|
@ -1208,7 +1208,7 @@ NGRAPH_TEST(onnx_editor, editor_api_use_edge_mapper_with_graph_cutter_custom_nam
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__use_edge_mapper_with_graph_cutter_custom_names.prototxt");
|
||||
"subgraph__use_edge_mapper_with_graph_cutter_custom_names.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -1218,7 +1218,7 @@ NGRAPH_TEST(onnx_editor, editor_api_use_edge_mapper_with_graph_cutter_custom_nam
|
|||
NGRAPH_TEST(onnx_editor, editor_api_find_output_consumers)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
std::vector<InputEdge> output_consumers = editor.find_output_consumers("relu1");
|
||||
EXPECT_EQ(output_consumers.size(), 3);
|
||||
|
|
@ -1245,7 +1245,7 @@ NGRAPH_TEST(onnx_editor, editor_api_find_output_consumers)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_find_output_consumers_empty_result)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const std::vector<InputEdge> output_consumers = editor.find_output_consumers("not_existed");
|
||||
EXPECT_EQ(output_consumers.size(), 0);
|
||||
|
|
@ -1254,7 +1254,7 @@ NGRAPH_TEST(onnx_editor, editor_api_find_output_consumers_empty_result)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_is_correct_and_unambiguous_node)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
bool is_correct_node = editor.is_correct_and_unambiguous_node(EditorNode{EditorOutput{"relu1"}});
|
||||
EXPECT_EQ(is_correct_node, true);
|
||||
|
|
@ -1281,7 +1281,7 @@ NGRAPH_TEST(onnx_editor, editor_api_is_correct_and_unambiguous_node)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_input_edge_from_tensor_with_single_consumer)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_ab.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_ab.onnx")};
|
||||
|
||||
const auto edge = editor.find_input_edge(EditorNode{EditorOutput{"Y"}}, EditorInput{1});
|
||||
editor.cut_graph_fragment({edge}, {});
|
||||
|
|
@ -1289,7 +1289,7 @@ NGRAPH_TEST(onnx_editor, editor_api_input_edge_from_tensor_with_single_consumer)
|
|||
const auto ref_model =
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/model_editor/reference/"
|
||||
"subgraph__twice_input_edge_from_tensor_with_single_consumer.prototxt");
|
||||
"subgraph__twice_input_edge_from_tensor_with_single_consumer.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -1299,7 +1299,7 @@ NGRAPH_TEST(onnx_editor, editor_api_input_edge_from_tensor_with_single_consumer)
|
|||
NGRAPH_TEST(onnx_editor, editor_api_input_edge_from_tensor_with_single_consumer_ambiguous)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_ab.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_ab.onnx")};
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -1318,7 +1318,7 @@ using TestEngine = test::INTERPRETER_Engine;
|
|||
NGRAPH_TEST(onnx_editor, values__append_one_initializer)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_1D.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_1D.onnx")};
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
in_vals.emplace("A", op::Constant::create(element::i64, Shape{2}, {1, 2}));
|
||||
|
|
@ -1334,7 +1334,7 @@ NGRAPH_TEST(onnx_editor, values__append_one_initializer)
|
|||
NGRAPH_TEST(onnx_editor, values__append_two_initializers_to_invalid)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_1D_invalid.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_1D_invalid.onnx")};
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
in_vals.emplace("A", op::Constant::create(element::i64, Shape{2}, {4, 2}));
|
||||
|
|
@ -1350,7 +1350,7 @@ NGRAPH_TEST(onnx_editor, values__append_two_initializers_to_invalid)
|
|||
NGRAPH_TEST(onnx_editor, values__modify_one_initializer)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_1D_with_initializers.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_1D_with_initializers.onnx")};
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
in_vals.emplace("B", op::Constant::create(element::i64, Shape{2}, {3, 4}));
|
||||
|
|
@ -1365,7 +1365,7 @@ NGRAPH_TEST(onnx_editor, values__modify_one_initializer)
|
|||
NGRAPH_TEST(onnx_editor, values__modify_two_initializers)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_1D_with_initializers.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_1D_with_initializers.onnx")};
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
in_vals.emplace("A", op::Constant::create(element::i64, Shape{2}, {3, 6}));
|
||||
|
|
@ -1381,7 +1381,7 @@ NGRAPH_TEST(onnx_editor, values__modify_two_initializers)
|
|||
NGRAPH_TEST(onnx_editor, values__no_inputs_modify_two_initializers)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_1D_with_initializers_only.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/add_1D_with_initializers_only.onnx")};
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
in_vals.emplace("A", op::Constant::create(element::i64, Shape{2}, {1, 2}));
|
||||
|
|
@ -1397,7 +1397,7 @@ NGRAPH_TEST(onnx_editor, values__no_inputs_modify_two_initializers)
|
|||
NGRAPH_TEST(onnx_editor, values__append_two_initializers_change_shape_type)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_1D.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/model_editor/add_1D.onnx")};
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
in_vals.emplace("A", op::Constant::create(element::i8, Shape{2, 1}, {-1, 1}));
|
||||
|
|
@ -1413,7 +1413,7 @@ NGRAPH_TEST(onnx_editor, values__append_two_initializers_change_shape_type)
|
|||
NGRAPH_TEST(onnx_editor, values__append_two_initializers_mixed_types)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gather_elements_float_3D_axis_2.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gather_elements_float_3D_axis_2.onnx")};
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
in_vals.emplace("data",
|
||||
|
|
@ -1430,14 +1430,14 @@ NGRAPH_TEST(onnx_editor, values__append_two_initializers_mixed_types)
|
|||
NGRAPH_TEST(onnx_editor, combined__cut_and_replace_shape)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph__inception_head.onnx")};
|
||||
|
||||
const auto new_shape = PartialShape({1, 64, 112, 112});
|
||||
editor.cut_graph_fragment({{InputEdge(1, 0)}}, {});
|
||||
editor.set_input_shapes({{"conv1/7x7_s2_1", new_shape}});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_head_cut.prototxt");
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/subgraph__linear_model_head_cut.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -1451,12 +1451,12 @@ NGRAPH_TEST(onnx_editor, combined__cut_and_replace_shape)
|
|||
NGRAPH_TEST(onnx_editor, cut_operator_with_no_schema)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/unknown_input_value_info.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/unknown_input_value_info.onnx")};
|
||||
|
||||
editor.cut_graph_fragment({{InputEdge{1, 0}}}, {});
|
||||
|
||||
const auto ref_model = file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/unknown_input_value_info.prototxt");
|
||||
SERIALIZED_ZOO, "onnx/model_editor/reference/unknown_input_value_info.onnx");
|
||||
|
||||
const auto result = compare_onnx_models(editor.model_string(), ref_model);
|
||||
|
||||
|
|
@ -1466,7 +1466,7 @@ NGRAPH_TEST(onnx_editor, cut_operator_with_no_schema)
|
|||
NGRAPH_TEST(onnx_editor, is_model_input)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
EXPECT_TRUE(editor.is_input(InputEdge{0, 0}));
|
||||
const auto edge1 = editor.find_input_edge(EditorOutput{"add1"}, 1);
|
||||
|
|
@ -1485,7 +1485,7 @@ NGRAPH_TEST(onnx_editor, is_model_input)
|
|||
NGRAPH_TEST(onnx_editor, is_model_output)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
EXPECT_TRUE(editor.is_output(OutputEdge{4, 0}));
|
||||
EXPECT_TRUE(editor.is_output(OutputEdge{5, 1}));
|
||||
|
|
@ -1502,7 +1502,7 @@ NGRAPH_TEST(onnx_editor, is_model_output)
|
|||
NGRAPH_TEST(onnx_editor, model_inputs)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const auto inputs = editor.model_inputs();
|
||||
EXPECT_TRUE(inputs == (std::vector<std::string>{"in1", "in2", "in3"})); // in4 is initializer
|
||||
|
|
@ -1511,7 +1511,7 @@ NGRAPH_TEST(onnx_editor, model_inputs)
|
|||
NGRAPH_TEST(onnx_editor, model_inputs_with_non_input_initializers)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/instance_norm_dynamic.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/instance_norm_dynamic.onnx")};
|
||||
|
||||
const auto inputs = editor.model_inputs();
|
||||
EXPECT_TRUE(inputs == (std::vector<std::string>{"input"}));
|
||||
|
|
@ -1520,7 +1520,7 @@ NGRAPH_TEST(onnx_editor, model_inputs_with_non_input_initializers)
|
|||
NGRAPH_TEST(onnx_editor, model_output)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
const auto outputs = editor.model_outputs();
|
||||
EXPECT_TRUE(outputs == (std::vector<std::string>{"mul1", "split2", "mul2"}));
|
||||
|
|
@ -1529,7 +1529,7 @@ NGRAPH_TEST(onnx_editor, model_output)
|
|||
NGRAPH_TEST(onnx_editor, get_tensor_shape)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
EXPECT_EQ(editor.get_tensor_shape("mul2"), (PartialShape{1, 1, 2, 2}));
|
||||
EXPECT_EQ(editor.get_tensor_shape("in1"), (PartialShape{2, 2}));
|
||||
|
|
@ -1553,7 +1553,7 @@ NGRAPH_TEST(onnx_editor, get_tensor_shape)
|
|||
NGRAPH_TEST(onnx_editor, get_tensor_shape_after_modification)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
EXPECT_EQ(editor.get_tensor_shape("in3"), (PartialShape{1, 1, 2, 2}));
|
||||
EXPECT_EQ(editor.get_tensor_shape("conv1"), (PartialShape{1, 1, 2, 2}));
|
||||
|
|
@ -1566,7 +1566,7 @@ NGRAPH_TEST(onnx_editor, get_tensor_shape_after_modification)
|
|||
NGRAPH_TEST(onnx_editor, is_correct_tensor_name)
|
||||
{
|
||||
ONNXModelEditor editor{file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.prototxt")};
|
||||
SERIALIZED_ZOO, "onnx/model_editor/subgraph_extraction_tests.onnx")};
|
||||
|
||||
EXPECT_TRUE(editor.is_correct_tensor_name("in1"));
|
||||
EXPECT_TRUE(editor.is_correct_tensor_name("relu1"));
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -56,7 +56,7 @@ namespace
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_scatter_elements)
|
||||
{
|
||||
const auto fn = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/scatter_elements_opset11.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/scatter_elements_opset11.onnx"));
|
||||
|
||||
test_constant_folding<float>(fn, {1.0, 1.1, 3.0, 2.1, 5.0}, Shape{1, 5});
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_scatter_elements)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_scalar)
|
||||
{
|
||||
const auto fn = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_scalar.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_scalar.onnx"));
|
||||
|
||||
test_constant_folding<int64_t>(fn, {0}, Shape{1, 1});
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_scalar)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_1d)
|
||||
{
|
||||
const auto fn = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_1d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_1d.onnx"));
|
||||
|
||||
test_constant_folding<int64_t>(fn, {1, 2, 4}, Shape{1, 3});
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_1d)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_1d_float)
|
||||
{
|
||||
const auto fn = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_1d_float.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_1d_float.onnx"));
|
||||
|
||||
test_constant_folding<int64_t>(fn, {0, 1, 3, 4, 5, 6, 7, 8, 9});
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_1d_float)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_3d)
|
||||
{
|
||||
const auto fn = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_3d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_3d.onnx"));
|
||||
|
||||
// Vertical slices are 3D indices of non-zero elements in the input tensor
|
||||
// {0, 0, 0, 1, 1, 2, 2}
|
||||
|
|
@ -101,7 +101,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_3d)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_const_folding_model_non_zero_2d_bool)
|
||||
{
|
||||
const auto fn = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_2d_bool.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/non_zero_2d_bool.onnx"));
|
||||
|
||||
test_constant_folding<int64_t>(fn, {0, 1, 1, 0});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME});
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_add)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add.onnx"));
|
||||
|
||||
// Shape inference tests
|
||||
const auto& parameters = function->get_parameters();
|
||||
|
|
@ -67,7 +67,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_add)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_cond)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_no_identity_termination_cond.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_no_identity_termination_cond.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
// termination condition
|
||||
|
|
@ -84,7 +84,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_co
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_trip_count_max_int)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add_trip_count_max_int.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add_trip_count_max_int.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
// termination condition
|
||||
|
|
@ -102,7 +102,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_co
|
|||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/loop/loop_2d_add_no_identity_termination_cond_static_shapes.prototxt"));
|
||||
"onnx/loop/loop_2d_add_no_identity_termination_cond_static_shapes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// termination condition
|
||||
|
|
@ -119,7 +119,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_co
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_cond_false)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_no_identity_termination_cond_false.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_no_identity_termination_cond_false.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -138,7 +138,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_no_identity_termination_co
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_const_no_identity_termination_cond)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_const_no_identity_termination_cond.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_const_no_identity_termination_cond.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
// a_init
|
||||
|
|
@ -154,7 +154,7 @@ NGRAPH_TEST(${BACKEND_NAME},
|
|||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/loop/loop_2d_add_const_no_identity_termination_cond_static_shapes.prototxt"));
|
||||
"onnx/loop/loop_2d_add_const_no_identity_termination_cond_static_shapes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -173,7 +173,7 @@ NGRAPH_TEST(${BACKEND_NAME},
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_both_cond_and_trip_count_as_inputs)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_cond_and_trip_count_as_inputs.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_cond_and_trip_count_as_inputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
// trip count
|
||||
|
|
@ -196,7 +196,7 @@ NGRAPH_TEST(${BACKEND_NAME},
|
|||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/loop/loop_2d_add_cond_and_trip_count_as_inputs_static_shapes.prototxt"));
|
||||
"onnx/loop/loop_2d_add_cond_and_trip_count_as_inputs_static_shapes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// trip count
|
||||
|
|
@ -217,7 +217,7 @@ NGRAPH_TEST(${BACKEND_NAME},
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_initializer_from_parent_scope)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_initializer_from_parent_scope.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_initializer_from_parent_scope.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_initializer_from_parent_s
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_node_from_parent_scope)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_node_from_parent_scope.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_node_from_parent_scope.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -248,7 +248,7 @@ NGRAPH_TEST(${BACKEND_NAME},
|
|||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/loop/loop_add_node_from_parent_scope_used_in_parent_and_in_body.prototxt"));
|
||||
"onnx/loop/loop_add_node_from_parent_scope_used_in_parent_and_in_body.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -267,7 +267,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_value_access_to_body_scop
|
|||
try
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_incorrect_access_body_scope.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_incorrect_access_body_scope.onnx"));
|
||||
FAIL() << "Incorrect access to body scope not detected";
|
||||
}
|
||||
catch (const ngraph_error& e)
|
||||
|
|
@ -285,7 +285,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_value_access_to_body_scop
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_value_the_same_node_from_parent_and_subgraph)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add_the_same_name.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add_the_same_name.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -299,7 +299,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_value_the_same_node_from_
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_input_from_parent_graph)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_input_from_parent_graph.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_input_from_parent_graph.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -315,7 +315,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_add_input_from_parent_graph)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_the_proper_opset_in_subgraph)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_mul_opset1.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_mul_opset1.onnx"));
|
||||
|
||||
const auto parent_ops = function->get_ops();
|
||||
const auto loop_node_it =
|
||||
|
|
@ -337,7 +337,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_the_proper_opset_in_subgraph)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_scalars)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_scalars_add.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_scalars_add.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -351,7 +351,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_scalars)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_add_const_cond)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add_const_cond.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add_const_cond.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -365,7 +365,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_add_const_cond)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_trip_count_dynamic)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add_trip_count_dynamic.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_2d_add_trip_count_dynamic.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
// trip count
|
||||
|
|
@ -384,7 +384,7 @@ NGRAPH_TEST(${BACKEND_NAME},
|
|||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/loop/onnx_controlflow_loop_2d_infer_types.prototxt"));
|
||||
"onnx/loop/onnx_controlflow_loop_2d_infer_types.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// trip count
|
||||
|
|
@ -406,7 +406,7 @@ NGRAPH_TEST(${BACKEND_NAME},
|
|||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/loop/loop_add_node_from_parent_scope_infer_types.prototxt"));
|
||||
"onnx/loop/loop_add_node_from_parent_scope_infer_types.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// a_init
|
||||
|
|
@ -426,7 +426,7 @@ NGRAPH_TEST(${BACKEND_NAME},
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_concat_values)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_concat_values.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_concat_values.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// trip_count
|
||||
|
|
@ -451,7 +451,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_concat_values)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_trip_count_and_cond_skipped_shape_inference)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_trip_count_and_cond_skipped.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_2d_add_trip_count_and_cond_skipped.onnx"));
|
||||
|
||||
const auto& results = function->get_results();
|
||||
EXPECT_EQ(results.size(), 2);
|
||||
|
|
@ -468,7 +468,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_2d_trip_count_and_cond_skippe
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_infinite)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_infinite.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_infinite.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// trip_count
|
||||
|
|
@ -490,7 +490,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_infinite)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_no_variadic_inputs_and_outputs)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_no_variadic_inputs_and_outputs.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/loop/loop_no_variadic_inputs_and_outputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
// trip_count
|
||||
|
|
@ -506,7 +506,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_no_variadic_inputs_and_output
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_controlflow_loop_power)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_pow.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/loop/loop_pow.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
// trip_count
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_padding)
|
|||
{
|
||||
// Convolution with strides=2 and padding=1
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_with_strides_padding.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_with_strides_padding.onnx"));
|
||||
|
||||
Inputs inputs;
|
||||
// data (1, 1, 7, 5) input tensor
|
||||
|
|
@ -72,7 +72,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_no_padding)
|
|||
{
|
||||
// Convolution with strides=2 and padding=1
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_with_strides_no_padding.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_with_strides_no_padding.onnx"));
|
||||
|
||||
Inputs inputs;
|
||||
// data (1, 1, 7, 5) input tensor
|
||||
|
|
@ -104,7 +104,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_assymetric_padding)
|
|||
{
|
||||
// Convolution with strides=2 and padding=1
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/conv_with_strides_and_asymmetric_padding.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/conv_with_strides_and_asymmetric_padding.onnx"));
|
||||
|
||||
Inputs inputs;
|
||||
// data (1, 1, 7, 5) input tensor
|
||||
|
|
@ -136,7 +136,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv2d_strides_assymetric_padding)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv2d_dilation_assymetric_pads_strides)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv2d_dilation_assym_pads_strides.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv2d_dilation_assym_pads_strides.onnx"));
|
||||
|
||||
// "", // auto_pad
|
||||
// vector<int64_t>{1, 1}, // dilations
|
||||
|
|
@ -178,7 +178,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv2d_dilation_assymetric_pads_strides)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv3d_bias)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv3d_bias.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv3d_bias.onnx"));
|
||||
|
||||
// "", // auto_pad
|
||||
// vector<int64_t>{2, 2, 2}, // dilations
|
||||
|
|
@ -294,7 +294,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv3d_bias)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_transpose_w_groups)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_transpose_w_groups.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_transpose_w_groups.onnx"));
|
||||
|
||||
Inputs inputs;
|
||||
inputs.emplace_back(std::vector<float>{
|
||||
|
|
@ -316,7 +316,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_average_pool_2d)
|
|||
{
|
||||
// Pooling with strides=2 and no padding
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/average_pool_2d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/average_pool_2d.onnx"));
|
||||
|
||||
// input data shape (1, 1, 4, 4)
|
||||
Inputs inputs;
|
||||
|
|
@ -339,7 +339,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_average_pool_2d_pads)
|
|||
{
|
||||
// Pooling with strides=2 and padding=1
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/average_pool_2d_pads.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/average_pool_2d_pads.onnx"));
|
||||
|
||||
// input data shape (1, 1, 4, 4)
|
||||
Inputs inputs;
|
||||
|
|
@ -364,7 +364,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_max_pool_2d_pads)
|
|||
{
|
||||
// Pooling with strides=2 and padding=1
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/max_pool_2d_pads.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/max_pool_2d_pads.onnx"));
|
||||
|
||||
// input data shape (1, 1, 4, 4)
|
||||
Inputs inputs;
|
||||
|
|
@ -388,7 +388,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_max_pool_2d_pads)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p0)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_p0.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_p0.onnx"));
|
||||
|
||||
std::vector<std::int64_t> input{1, 0, -4, 0, 2, 1, -6, 1, 0, 0, 0, 0,
|
||||
-7, 1, -1, 0, -1, 8, 0, 10, 9, 0, 0, 5};
|
||||
|
|
@ -404,7 +404,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p0)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p1)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_p1.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_p1.onnx"));
|
||||
|
||||
Inputs inputs{std::vector<float>(2 * 3 * 4)};
|
||||
std::iota(std::begin(inputs.front()), std::end(inputs.front()), 0.f);
|
||||
|
|
@ -420,7 +420,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p1)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p2)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_p2.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_p2.onnx"));
|
||||
|
||||
Inputs inputs{std::vector<float>(2 * 3 * 4)};
|
||||
std::iota(std::begin(inputs.front()), std::end(inputs.front()), 0.f);
|
||||
|
|
@ -436,7 +436,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p2)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p3)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_p3.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_p3.onnx"));
|
||||
|
||||
Inputs inputs{std::vector<float>(2 * 3 * 4)};
|
||||
std::iota(std::begin(inputs.front()), std::end(inputs.front()), 0.f);
|
||||
|
|
@ -452,7 +452,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_global_lp_pool_p3)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_output_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_output_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -467,7 +467,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape_auto_pads_same_upper)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/convtranspose_output_shape_auto_pads_same_upper.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/convtranspose_output_shape_auto_pads_same_upper.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -495,7 +495,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape_auto_pads_sam
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape_auto_pads_same_lower)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/convtranspose_output_shape_auto_pads_same_lower.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/convtranspose_output_shape_auto_pads_same_lower.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_output_shape_auto_pads_sam
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_groups_w_pads)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_groups_w_pads.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_groups_w_pads.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -576,7 +576,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_groups_w_pads)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_convtranspose_groups_pads_bias)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_groups_pads_bias.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_groups_pads_bias.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_onnx_dynamic_dims_to_ngraph_dynamic
|
|||
// the model represents a linear function A * x + B
|
||||
// where all 3 operands are model inputs (no initializers)
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/ab_plus_c.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/ab_plus_c.onnx"));
|
||||
|
||||
const auto& graph_inputs = function->get_parameters();
|
||||
EXPECT_EQ(graph_inputs.size(), 3);
|
||||
|
|
@ -73,7 +73,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_onnx_dynamic_dims_to_ngraph_dynamic
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_ab_plus_c_inference)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/ab_plus_c.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/ab_plus_c.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_scalar_initializers_shape_check)
|
|||
// initializers defined witout the "dims" field should produce Constants with an empty Shape
|
||||
// initializers with "dims: 0" should be have the same way (Shape{} not Shape{0})
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/scalar_initializers.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/scalar_initializers.onnx"));
|
||||
|
||||
for (auto ng_node : function->get_ordered_ops())
|
||||
{
|
||||
|
|
@ -130,7 +130,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_dynamic_rank_input_check)
|
|||
{
|
||||
// the model contains a single Add operation that takes a fully dynamic input and a scalar
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/a_plus_b_dyn_rank.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/a_plus_b_dyn_rank.onnx"));
|
||||
|
||||
const auto& graph_inputs = function->get_parameters();
|
||||
ASSERT_EQ(graph_inputs.size(), 2);
|
||||
|
|
@ -154,7 +154,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_dynamic_rank_input_inference)
|
|||
{
|
||||
// the model contains a single Add operation that takes a fully dynamic input and a scalar
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/a_plus_b_dyn_rank.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/a_plus_b_dyn_rank.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_dynamic_rank_input_inference)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_acosh_1_3)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/acosh_dyn_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/acosh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{1, 3}, {1.0f, 2.5f, 4.3f});
|
||||
|
|
@ -195,7 +195,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_acosh_1_3)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_acosh_3_2)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/acosh_dyn_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/acosh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{3, 2}, {1.0f, 2.5f, 4.3f, 1.0f, 2.5f, 4.3f});
|
||||
|
|
@ -208,7 +208,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_acosh_3_2)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_asinh_1_3)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/asinh_dyn_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/asinh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{1, 3}, {-1.5f, 0.0f, 1.5f});
|
||||
|
|
@ -220,7 +220,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_asinh_1_3)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_asinh_3_2)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/asinh_dyn_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/asinh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{3, 2}, {-1.5f, 0.0f, 1.5f, -1.5f, 0.0f, 1.5f});
|
||||
|
|
@ -233,7 +233,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_asinh_3_2)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_atanh_1_3)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/atanh_dyn_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/atanh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{1, 3}, {-0.9f, 0.0f, 0.9f});
|
||||
|
|
@ -245,7 +245,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_atanh_1_3)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_atanh_3_2)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/atanh_dyn_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/atanh_dyn_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{3, 2}, {-0.9f, 0.0f, 0.9f, -0.9f, 0.0f, 0.9f});
|
||||
|
|
@ -258,7 +258,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_atanh_3_2)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_conv_with_dynamic_batch)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/conv_with_dynamic_batch.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/conv_with_dynamic_batch.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_conv_with_dynamic_batch)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_conv_with_dynamic_bias)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/conv_with_dynamic_bias.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/conv_with_dynamic_bias.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_conv_with_dynamic_bias)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_avg_pool_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/average_pool_2d_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/average_pool_2d_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -324,7 +324,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_avg_pool_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_max_pool_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/max_pool_2d_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/max_pool_2d_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -344,7 +344,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_max_pool_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_max_pool_with_indices_output)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/max_pool_with_indices_output.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/max_pool_with_indices_output.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_max_pool_with_indices_output)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_global_avg_pool_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/global_average_pool_dyn.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/global_average_pool_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -389,7 +389,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_global_avg_pool_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_global_max_pool_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/global_max_pool_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/global_max_pool_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -409,7 +409,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_global_max_pool_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_arg_max_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/argmax_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/argmax_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -429,7 +429,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_arg_max_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_arg_min_no_keep_dims_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/argmin_no_keep_dims_dyn.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/argmin_no_keep_dims_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_arg_min_no_keep_dims_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_constant_of_shape_float_zeros)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/constant_of_shape_float_zeros.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/constant_of_shape_float_zeros.onnx"));
|
||||
|
||||
std::vector<float> expected_values(24, 0);
|
||||
|
||||
|
|
@ -464,7 +464,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_constant_of_shape_float_zeros)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_constant_of_shape_int_ones)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/constant_of_shape_int_ones.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/constant_of_shape_int_ones.onnx"));
|
||||
|
||||
std::vector<int32_t> expected_values(6, 1);
|
||||
|
||||
|
|
@ -479,7 +479,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_constant_of_shape_int_ones)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_1_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_1_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_2_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -514,7 +514,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_2_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_3_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -530,7 +530,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_3_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_4_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -546,7 +546,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_4_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_5_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -563,7 +563,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_5_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_6_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -581,7 +581,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_6_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_uint16_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_uint16_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/expand_uint16_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -597,7 +597,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_expand_uint16_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_tile)
|
||||
{
|
||||
auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/tile.prototxt"));
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/tile.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<std::int16_t>({0, 1, 2, 3, 4, 5}); // input
|
||||
|
|
@ -609,7 +609,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_tile)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_tile_static)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/tile_static.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/tile_static.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<std::int16_t>({0, 1, 2, 3, 4, 5}); // input
|
||||
|
|
@ -621,7 +621,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_tile_static)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_convtranspose_dyn_data)
|
||||
{
|
||||
auto ct_fn = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_dyn_data.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_dyn_data.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(ct_fn);
|
||||
|
||||
|
|
@ -680,7 +680,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_convtranspose_dyn_data)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_convtranspose_dyn_filters)
|
||||
{
|
||||
auto ct_fn = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_dyn_filters.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/convtranspose_dyn_filters.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(ct_fn);
|
||||
|
||||
|
|
@ -738,7 +738,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_convtranspose_dyn_filters)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_transpose)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/transpose.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/transpose.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
Shape shape{2, 2, 4, 3};
|
||||
|
|
@ -775,7 +775,7 @@ namespace
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_axis_0)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/flatten_dyn_shape_axis0.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/flatten_dyn_shape_axis0.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
const size_t RANKS_TO_TEST = 4;
|
||||
|
|
@ -802,7 +802,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_axis_0)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_axis)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/flatten_dyn_shape_axis.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/flatten_dyn_shape_axis.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
const size_t RANKS_TO_TEST = 4;
|
||||
|
|
@ -829,7 +829,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_axis)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_neg_axis)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/flatten_dyn_shape_neg_axis.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/flatten_dyn_shape_neg_axis.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
const size_t RANKS_TO_TEST = 4;
|
||||
|
|
@ -856,7 +856,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_flatten_neg_axis)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_flatten)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/flatten.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/flatten.onnx"));
|
||||
|
||||
std::vector<float> data{1, 2, 3, 4, 5, 6, 7, 8};
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
|
@ -869,7 +869,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_flatten)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_global_lp_dynamic_hw)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_dynamic_hw.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/global_lp_pool_dynamic_hw.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<int64_t>(Shape{1, 2, 3, 4}, {1, 0, -4, 0, 2, 1, -6, 1, 0, 0, 0, 0,
|
||||
|
|
@ -882,7 +882,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_model_global_lp_dynamic_hw)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_2d_input)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_input.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_input.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
|
|
@ -896,7 +896,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_2d_input)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_default_steps)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_default_steps.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_default_steps.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>({1, 2, 3, 4, 5, 6, 7, 8});
|
||||
|
|
@ -909,7 +909,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_default_steps)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_slice_2d_default_steps_dyn_begin_end)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_default_steps_dyn_begin_end.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_default_steps_dyn_begin_end.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>({1, 2, 3, 4});
|
||||
|
|
@ -922,7 +922,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_slice_2d_default_steps_dyn
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_clamp_neg_ends)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_default_steps.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_default_steps.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
|
|
@ -935,7 +935,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_clamp_neg_ends)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -953,7 +953,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_neg_axes)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input_neg_axes.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input_neg_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -971,7 +971,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_neg_axes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_12_axes)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input_12_axes.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input_12_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -988,7 +988,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_12_axes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_20_axes)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input_20_axes.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input_20_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1006,7 +1006,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_3d_input_20_axes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_23_axes)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_4d_input_23_axes.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_4d_input_23_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1023,7 +1023,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_23_axes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_0231_axes_ends_max)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_4d_input_0231_axes_ends_max.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_4d_input_0231_axes_ends_max.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1043,7 +1043,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_0231_axes_ends_ma
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_2103_axes_ends_max)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_4d_input_2103_axes.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_4d_input_2103_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1064,7 +1064,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_2103_axes_ends_ma
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_23_axes_21_steps)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_4d_input_23_axes_21_steps.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_4d_input_23_axes_21_steps.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1082,7 +1082,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_4d_input_23_axes_21_steps)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_default_axes)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_default_axes.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_default_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1098,7 +1098,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_10_default_axes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_10_the_same_output_same)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_the_same_out_shape.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_the_same_out_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(std::vector<float>{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f});
|
||||
|
|
@ -1110,7 +1110,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_10_the_same_output_same)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_model_hardmax)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/hardmax.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/hardmax.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(
|
||||
|
|
@ -1146,7 +1146,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_model_hardmax)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_model_softmax_axis_2)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/softmax_axis_2.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/softmax_axis_2.onnx"));
|
||||
|
||||
const std::vector<float> input = {
|
||||
2.75793882, -0.50841322, 0.82013929, -0.62409912, -0.96136118, 0.21004745, 1.38337255,
|
||||
|
|
@ -1184,7 +1184,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_model_softmax_axis_2)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_range_positive_step)
|
||||
{
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/range.prototxt"));
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/range.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1199,7 +1199,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_range_positive_step)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_range_negative_step)
|
||||
{
|
||||
const auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/range.prototxt"));
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/range.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1214,7 +1214,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_range_negative_step)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/instance_norm_dyn_shape.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/instance_norm_dyn_shape.onnx"));
|
||||
|
||||
Shape data_shape{1, 2, 3, 4};
|
||||
std::vector<float> data(shape_size(data_shape));
|
||||
|
|
@ -1236,7 +1236,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape2)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/instance_norm_dyn_shape2.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/instance_norm_dyn_shape2.onnx"));
|
||||
|
||||
Shape data_shape{1, 2, 3, 4};
|
||||
std::vector<float> data(shape_size(data_shape));
|
||||
|
|
@ -1258,7 +1258,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape2)
|
|||
// NGRAPH_TEST(${BACKEND_NAME}, onnx_upsample9_scales_input_nearest_infer)
|
||||
// {
|
||||
// const auto function = onnx_import::import_onnx_model(
|
||||
// file_util::path_join(SERIALIZED_ZOO, "onnx/upsample9_scales_input_nearest.prototxt"));
|
||||
// file_util::path_join(SERIALIZED_ZOO, "onnx/upsample9_scales_input_nearest.onnx"));
|
||||
//
|
||||
// // Input data shape (1, 1, 2, 2)
|
||||
// // mode: nearest
|
||||
|
|
@ -1276,7 +1276,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_instance_normalization_dyn_shape2)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_2d_input)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_input_opset1.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_input_opset1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
|
|
@ -1287,7 +1287,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_2d_input)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_clamp_neg_ends)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_clamp_neg_ends_opset1.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_2d_clamp_neg_ends_opset1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
|
|
@ -1298,7 +1298,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_clamp_neg_ends)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_slice_1_3d_input_21_axes_ends_max)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input_21_axes_ends_max_opset1.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/slice_3d_input_21_axes_ends_max_opset1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1315,7 +1315,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_reduce_max_dynamic_input_rank_negat
|
|||
// the ReduceMax node has a fully dynamic input and the reduction axis is -1
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/dynamic_shapes/reduce_max_dynamic_input_rank_negative_axis.prototxt"));
|
||||
"onnx/dynamic_shapes/reduce_max_dynamic_input_rank_negative_axis.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{2, 4}, std::vector<float>{1, 2, 3, 4, 5, 6, 7, 8});
|
||||
|
|
@ -1326,7 +1326,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_shapes_reduce_max_dynamic_input_rank_negat
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_size_dyn_op)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/size_op_dyn.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/size_op_dyn.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{2, 3}, {1.0, 2.0, 3.0, 4.0, 5.0, 6.0});
|
||||
|
|
@ -1337,7 +1337,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_size_dyn_op)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_max_pool_dyn_rank_without_default_attrs)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/max_pool_dyn_rank_without_default_attrs.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/max_pool_dyn_rank_without_default_attrs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -1352,7 +1352,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_max_pool_dyn_rank_without_default_attrs)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_dynamic_input)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/depth_to_space.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/depth_to_space.onnx"));
|
||||
|
||||
std::vector<float> input(32);
|
||||
std::iota(input.begin(), input.end(), 0);
|
||||
|
|
@ -1370,7 +1370,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_dynamic_input)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_space_to_depth_dynamic_input)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/space_to_depth.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/space_to_depth.onnx"));
|
||||
|
||||
std::vector<float> input(32);
|
||||
std::iota(input.begin(), input.end(), 0);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ using namespace ngraph;
|
|||
TEST(onnx_importer, exception_throws_ngraph_error)
|
||||
{
|
||||
EXPECT_THROW(onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/depth_to_space_bad_blocksize.prototxt")),
|
||||
SERIALIZED_ZOO, "onnx/depth_to_space_bad_blocksize.onnx")),
|
||||
ngraph_error);
|
||||
}
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ TEST(onnx_importer, exception_msg_ngraph_error)
|
|||
try
|
||||
{
|
||||
onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_bad_blocksize.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_bad_blocksize.onnx"));
|
||||
// Should have thrown, so fail if it didn't
|
||||
FAIL() << "ONNX Importer did not detected incorrect model!";
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ TEST(onnx_importer, exception_msg_onnx_node_validation_failure)
|
|||
try
|
||||
{
|
||||
onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/instance_norm_bad_scale_type.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/instance_norm_bad_scale_type.onnx"));
|
||||
// Should have thrown, so fail if it didn't
|
||||
FAIL() << "ONNX Importer did not detected incorrect model!";
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ TEST(onnx_importer, exception_msg_std_err_wrapped)
|
|||
try
|
||||
{
|
||||
onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/eye_link_dyn_shape.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/eye_link_dyn_shape.onnx"));
|
||||
// Should have thrown, so fail if it didn't
|
||||
FAIL() << "ONNX Importer did not detected incorrect model!";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME});
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/external_data/external_data.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/external_data/external_data.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
|
|
@ -36,7 +36,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data_from_stream)
|
||||
{
|
||||
std::string path =
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/external_data/external_data.prototxt");
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/external_data/external_data.onnx");
|
||||
std::ifstream stream{path, std::ios::in | std::ios::binary};
|
||||
ASSERT_TRUE(stream.is_open());
|
||||
const auto function = onnx_import::import_onnx_model(stream, path);
|
||||
|
|
@ -50,10 +50,10 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data_from_stream)
|
|||
stream.close();
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data_optinal_fields)
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data_optional_fields)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/external_data/external_data_optional_fields.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/external_data/external_data_optional_fields.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
|
|
@ -65,7 +65,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data_optinal_fields)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data_in_different_paths)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/external_data/external_data_different_paths.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/external_data/external_data_different_paths.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// first input: {3.f}, second: {1.f, 2.f, 5.f} read from external files
|
||||
|
|
@ -79,7 +79,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_two_tensors_data_in_the_same_file)
|
|||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/external_data/external_data_two_tensors_data_in_the_same_file.prototxt"));
|
||||
"onnx/external_data/external_data_two_tensors_data_in_the_same_file.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// first input: {3, 2, 1}, second: {1, 2, 3} read from external file
|
||||
|
|
@ -94,7 +94,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_invalid_external_data_exception)
|
|||
try
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/external_data/external_data_file_not_found.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/external_data/external_data_file_not_found.onnx"));
|
||||
FAIL() << "Incorrect path to external data not detected";
|
||||
}
|
||||
catch (const ngraph_error& error)
|
||||
|
|
@ -116,7 +116,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_invalid_up_dir_path)
|
|||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/external_data/inner_scope/external_data_file_in_up_dir.prototxt"));
|
||||
"onnx/external_data/inner_scope/external_data_file_in_up_dir.onnx"));
|
||||
FAIL() << "Incorrect path to external data not detected";
|
||||
}
|
||||
catch (const ngraph_error& error)
|
||||
|
|
@ -135,7 +135,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_invalid_up_dir_path)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_external_data_sanitize_path)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/external_data/external_data_sanitize_test.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/external_data/external_data_sanitize_test.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({1.f, 2.f, 3.f, 4.f});
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME});
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_prior_box)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/prior_box.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/prior_box.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
std::vector<float> A(3 * 2 * 2);
|
||||
std::vector<float> B(3 * 6 * 6);
|
||||
|
|
@ -78,7 +78,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_prior_box)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_priorbox_clustered)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/priorbox_clustered.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/priorbox_clustered.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
std::vector<float> A{15.0};
|
||||
|
|
@ -96,7 +96,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_priorbox_clustered)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_priorbox_clustered_most_attrs_default)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/priorbox_clustered_most_attrs_default.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/priorbox_clustered_most_attrs_default.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
std::vector<float> A(1 * 1 * 2 * 1);
|
||||
|
|
@ -130,7 +130,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_priorbox_clustered_first_input_bad_shape)
|
|||
try
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/priorbox_clustered_first_input_bad_shape.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/priorbox_clustered_first_input_bad_shape.onnx"));
|
||||
FAIL() << "Expected exception was not thrown";
|
||||
}
|
||||
catch (const ngraph::ngraph_error& e)
|
||||
|
|
@ -150,7 +150,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_priorbox_clustered_second_input_bad_shape)
|
|||
try
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/priorbox_clustered_second_input_bad_shape.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/priorbox_clustered_second_input_bad_shape.onnx"));
|
||||
FAIL() << "Expected exception was not thrown";
|
||||
}
|
||||
catch (const ngraph::ngraph_error& e)
|
||||
|
|
@ -168,7 +168,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_priorbox_clustered_second_input_bad_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_detection_output)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/detection_output.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/detection_output.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
auto gen_vector = [](size_t size, float min, float max) -> std::vector<float> {
|
||||
|
|
@ -199,7 +199,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_detection_output)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/group_norm.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/group_norm.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
Shape shape{2, 8, 2, 2};
|
||||
int size = shape_size(shape);
|
||||
|
|
@ -224,7 +224,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm_5d)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/group_norm_5d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/group_norm_5d.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
Shape shape{2, 8, 1, 2, 1};
|
||||
int size = shape_size(shape);
|
||||
|
|
@ -247,7 +247,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_group_norm_5d)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_normalize)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/normalize.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/normalize.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
std::vector<float> data(12);
|
||||
std::iota(data.begin(), data.end(), 1);
|
||||
|
|
@ -273,7 +273,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_normalize)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_swish_with_beta)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/swish_with_beta.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/swish_with_beta.onnx"));
|
||||
|
||||
const Shape expected_output_shape{3};
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
|
@ -287,7 +287,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_swish_with_beta)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_swish_without_beta)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/swish_without_beta.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/swish_without_beta.onnx"));
|
||||
|
||||
const Shape expected_output_shape{3};
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
|
@ -302,7 +302,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_detection_output)
|
|||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/detection_output.prototxt"));
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/detection_output.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// rois
|
||||
|
|
@ -366,7 +366,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_detection_output_
|
|||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/"
|
||||
"detection_output_most_attrs_default.prototxt"));
|
||||
"detection_output_most_attrs_default.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// rois
|
||||
|
|
@ -413,7 +413,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_generate_proposal
|
|||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/"
|
||||
"generate_proposals_single_image.prototxt"));
|
||||
"generate_proposals_single_image.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// im_info
|
||||
|
|
@ -468,7 +468,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_generate_proposal
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_group_norm)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/org.openvinotoolkit/experimental_detectron/group_norm.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/org.openvinotoolkit/experimental_detectron/group_norm.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
Shape shape{2, 8, 2, 2};
|
||||
|
|
@ -495,7 +495,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_prior_grid_genera
|
|||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/prior_grid_generator.prototxt"));
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/prior_grid_generator.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -522,7 +522,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_roi_feature_extra
|
|||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO,
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.prototxt"));
|
||||
"onnx/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_roi_feature_extra
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_topk_rios)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/org.openvinotoolkit/experimental_detectron/topk_rios.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/org.openvinotoolkit/experimental_detectron/topk_rios.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
|
||||
|
|
@ -594,7 +594,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_topk_rios)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_deformable_conv_2d)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/org.openvinotoolkit/deformable_conv_2d.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/org.openvinotoolkit/deformable_conv_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ static std::string s_manifest = "${MANIFEST}";
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_provenance_tag_text)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_tag_add.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_tag_add.onnx"));
|
||||
|
||||
const auto ng_nodes = function->get_ordered_ops();
|
||||
for (auto ng_node : ng_nodes)
|
||||
|
|
@ -60,7 +60,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_provenance_only_output)
|
|||
// the Add node in the model does not have a name,
|
||||
// only its output name should be found in the provenance tags
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_only_outputs.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_only_outputs.onnx"));
|
||||
test_provenance_tags<default_opset::Add>(function, "<ONNX Add (-> output_of_add)>");
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_provenance_node_name_and_outputs)
|
|||
test::ProvenanceEnabler provenance_enabler;
|
||||
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_node_name_and_outputs.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_node_name_and_outputs.onnx"));
|
||||
test_provenance_tags<default_opset::Add>(function, "<ONNX Add (Add_node -> output_of_add)>");
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_provenance_multiple_outputs_op)
|
|||
test::ProvenanceEnabler provenance_enabler;
|
||||
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_multiple_outputs_op.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_multiple_outputs_op.onnx"));
|
||||
test_provenance_tags<default_opset::TopK>(function, "<ONNX TopK (TOPK -> values, indices)>");
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_provenance_tagging_constants)
|
|||
test::ProvenanceEnabler provenance_enabler;
|
||||
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_input_tags.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_input_tags.onnx"));
|
||||
test_provenance_tags<default_opset::Constant>(function,
|
||||
"<ONNX Input (initializer_of_A) Shape:{1}>");
|
||||
}
|
||||
|
|
@ -97,6 +97,6 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_provenance_tagging_parameters)
|
|||
test::ProvenanceEnabler provenance_enabler;
|
||||
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_input_tags.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/provenance_input_tags.onnx"));
|
||||
test_provenance_tags<default_opset::Parameter>(function, "<ONNX Input (input_B) Shape:{}>");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ using Outputs = std::vector<std::vector<float>>;
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_const_scale_const_zero_p)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<float>{32.25f, 48.34f, 50.f, 83.f});
|
||||
|
|
@ -48,7 +48,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_const_scale_const_zero_p
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<float>{32.25f, 48.34f, 50.f, 83.f});
|
||||
|
|
@ -61,7 +61,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_zero_point)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear_zero_point.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<float>{0.f, 2.f, 3.f, 1000.f, -254.f, -1000.f}); // x
|
||||
|
|
@ -76,7 +76,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_zero_point)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_axis_zero)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear_axis_zero.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear_axis_zero.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<float>{
|
||||
|
|
@ -95,7 +95,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_axis_zero)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_axis_negative)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear_axis_negative.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quantize_linear_axis_negative.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<float>{
|
||||
|
|
@ -114,7 +114,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quantize_linear_axis_negative)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequant_lin.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequant_lin.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10});
|
||||
|
|
@ -126,7 +126,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_scale_and_zero_point)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_scalar_scale_and_zero_point.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_scalar_scale_and_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10}); // x
|
||||
|
|
@ -140,7 +140,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_scale_and_zero_
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_scale)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_scalar_scale.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_scalar_scale.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10}); // x
|
||||
|
|
@ -154,7 +154,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_scale)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_inputs)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_scalar_inputs.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_scalar_inputs.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19}); // x
|
||||
|
|
@ -168,7 +168,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_inputs)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_point)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_scalar_zero_point.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_scalar_zero_point.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<std::uint8_t>{19, 210, 21, 10}); // x
|
||||
|
|
@ -183,7 +183,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_point)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_scale_uint8)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_0.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_0.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input(std::vector<uint8_t>{0, 3, 128, 255}); // x
|
||||
|
|
@ -197,7 +197,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_scale_uint
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_scale_int8)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_1.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_1.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_scalar_zero_scale_int8
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_uint8)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_2.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_2.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_uint8)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_int8)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_3.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_3.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_int8)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_int8_4d)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_4.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_4.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_int8_4d)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_uint8_negative_axis)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_5.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dequantize_linear_5.onnx"));
|
||||
|
||||
auto test_case = ngraph::test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_dequantize_linear_1d_zero_scale_uint8_ne
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quant_conv_lin.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/quant_conv_lin.onnx"));
|
||||
|
||||
std::vector<std::vector<std::uint8_t>> inputs;
|
||||
inputs.emplace_back(std::vector<std::uint8_t>{
|
||||
|
|
@ -313,7 +313,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear_2d)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/qlinear_conv_2d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/qlinear_conv_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -334,7 +334,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear_2d)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear_3d)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/qlinear_conv_3d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/qlinear_conv_3d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -355,7 +355,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_quant_conv_linear_3d)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_qlinear_matmul_3d)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/qlinear_matmul_3d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/qlinear_matmul_3d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -380,7 +380,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_qlinear_matmul_3d)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_integer)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_integer.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_integer.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
test_case.add_input(std::vector<uint8_t>{2, 3, 4, 5, 6, 7, 8, 9, 10}); // x
|
||||
|
|
@ -394,7 +394,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_integer)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_integer_zero_point_zero)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_integer.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_integer.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
test_case.add_input(std::vector<uint8_t>{1, 2, 3, 4, 5, 6, 7, 8, 9}); // x
|
||||
|
|
@ -408,7 +408,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_integer_zero_point_zero)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_integer_no_zero_point)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_integer_no_zero_point.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_integer_no_zero_point.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
test_case.add_input(std::vector<uint8_t>{1, 2, 3, 4, 5, 6, 7, 8, 9}); // x
|
||||
|
|
@ -421,7 +421,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_integer_no_zero_point)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_integer_pads)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_integer_pads.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/conv_integer_pads.onnx"));
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
test_case.add_input(std::vector<uint8_t>{2, 3, 4, 5, 6, 7, 8, 9, 10}); // x
|
||||
|
|
@ -437,7 +437,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_conv_integer_pads)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_import_only)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/quantization/fake_quantize_const_inputs.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/quantization/fake_quantize_const_inputs.onnx"));
|
||||
|
||||
const Shape expected_output_shape{1, 2, 3, 4};
|
||||
EXPECT_EQ(function->get_output_size(), 1);
|
||||
|
|
@ -449,7 +449,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_import_only)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_const_inputs_infer)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/quantization/fake_quantize_const_inputs.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/quantization/fake_quantize_const_inputs.onnx"));
|
||||
|
||||
const Shape data_shape{1, 2, 3, 4};
|
||||
const auto n_elements = shape_size(data_shape);
|
||||
|
|
@ -468,7 +468,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_const_inputs_infer)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_fake_quantize_nonconst_inputs_infer)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/quantization/fake_quantize_nonconst_inputs.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/quantization/fake_quantize_nonconst_inputs.onnx"));
|
||||
|
||||
const Shape data_shape{1, 2, 3, 4};
|
||||
const size_t n_elements = shape_size(data_shape);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ using Outputs = std::vector<std::vector<float>>;
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_reduced_dims)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_reduced_dims.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_reduced_dims.onnx"));
|
||||
|
||||
// input data shape (2, 3, 4)
|
||||
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
|
||||
|
|
@ -57,7 +57,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_reduced_dims)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_reordered_dims)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_reordered_dims.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_reordered_dims.onnx"));
|
||||
|
||||
// input data shape (2, 3, 4)
|
||||
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
|
||||
|
|
@ -80,7 +80,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_reordered_dims)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_extended_dims)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_extended_dims.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_extended_dims.onnx"));
|
||||
|
||||
// input data shape (2, 3, 4)
|
||||
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
|
||||
|
|
@ -102,7 +102,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_extended_dims)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_single_dim)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_single_dim.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_single_dim.onnx"));
|
||||
|
||||
// input data shape (2, 3, 4)
|
||||
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
|
||||
|
|
@ -124,7 +124,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_dim)
|
|||
{
|
||||
// the model contains the target shape in the initializers: [2, -1, 2]
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_negative_dim.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_negative_dim.onnx"));
|
||||
|
||||
// 2x3x4
|
||||
auto input = test::NDArray<float, 3>({{{0.5488135, 0.71518934, 0.60276335, 0.5448832},
|
||||
|
|
@ -161,7 +161,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_dim)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_with_zero_dim)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_negative_with_zero_dims.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_negative_with_zero_dims.onnx"));
|
||||
|
||||
// input data shape (2, 3, 4)
|
||||
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
|
||||
|
|
@ -183,7 +183,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_negative_with_zero_dim)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_output_shape_as_input)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_output_shape_as_input.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/reshape_output_shape_as_input.onnx"));
|
||||
|
||||
// input data shape (2, 3, 4)
|
||||
auto input = test::NDArray<float, 3>({{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}},
|
||||
|
|
@ -205,7 +205,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_reshape_output_shape_as_input)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space.onnx"));
|
||||
|
||||
std::vector<float> input(32);
|
||||
std::iota(input.begin(), input.end(), 0);
|
||||
|
|
@ -223,7 +223,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_v1)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_v1.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_v1.onnx"));
|
||||
|
||||
std::vector<float> input(32);
|
||||
std::iota(input.begin(), input.end(), 0);
|
||||
|
|
@ -241,7 +241,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_v1)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_crd)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_crd.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_crd.onnx"));
|
||||
|
||||
std::vector<float> input(32);
|
||||
std::iota(input.begin(), input.end(), 0);
|
||||
|
|
@ -262,7 +262,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_bad_blocksize)
|
|||
// This model fails to import since the depth channel length must be a multiple of the
|
||||
// `blocksize` attribute value.
|
||||
EXPECT_THROW(onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/depth_to_space_bad_blocksize.prototxt")),
|
||||
SERIALIZED_ZOO, "onnx/depth_to_space_bad_blocksize.onnx")),
|
||||
std::runtime_error);
|
||||
}
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_no_blocksize)
|
|||
{
|
||||
// This model fails to import since it lacks of required parameter `blocksize`.
|
||||
EXPECT_THROW(onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/depth_to_space_no_blocksize.prototxt")),
|
||||
SERIALIZED_ZOO, "onnx/depth_to_space_no_blocksize.onnx")),
|
||||
std::runtime_error);
|
||||
}
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_bad_mode)
|
|||
try
|
||||
{
|
||||
onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_bad_mode.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_bad_mode.onnx"));
|
||||
FAIL() << "The onnx_importer did not throw for unknown mode to DepthToSpace op";
|
||||
}
|
||||
catch (const ngraph::ngraph_error& e)
|
||||
|
|
@ -298,7 +298,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_bad_input_shape)
|
|||
try
|
||||
{
|
||||
onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_bad_input_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/depth_to_space_bad_input_shape.onnx"));
|
||||
FAIL() << "The onnx_importer did not throw for invalid input shape to DepthToSpace op";
|
||||
}
|
||||
catch (const ngraph::ngraph_error& e)
|
||||
|
|
@ -315,7 +315,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_depth_to_space_bad_input_shape)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_space_to_depth)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/space_to_depth.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/space_to_depth.onnx"));
|
||||
|
||||
std::vector<float> input(32);
|
||||
std::iota(input.begin(), input.end(), 0);
|
||||
|
|
@ -336,7 +336,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_space_to_depth_invalid_input_shape)
|
|||
try
|
||||
{
|
||||
onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/space_to_depth_invalid_input_shape.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/space_to_depth_invalid_input_shape.onnx"));
|
||||
FAIL() << "Expected ngraph_error exception, but no exception was thrown";
|
||||
}
|
||||
catch (const ngraph::ngraph_error& e)
|
||||
|
|
@ -357,7 +357,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_space_to_depth_bad_blocksize)
|
|||
// This model fails to import since the depth channel length must be a multiple of the
|
||||
// `blocksize` attribute value.
|
||||
EXPECT_THROW(onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/space_to_depth_bad_blocksize.prototxt")),
|
||||
SERIALIZED_ZOO, "onnx/space_to_depth_bad_blocksize.onnx")),
|
||||
std::runtime_error);
|
||||
}
|
||||
|
||||
|
|
@ -365,14 +365,14 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_space_to_depth_no_blocksize)
|
|||
{
|
||||
// This model fails to import since it lacks of required `blocksize` attribute.
|
||||
EXPECT_THROW(onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/space_to_depth_no_blocksize.prototxt")),
|
||||
SERIALIZED_ZOO, "onnx/space_to_depth_no_blocksize.onnx")),
|
||||
std::runtime_error);
|
||||
}
|
||||
|
||||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_squeeze)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/squeeze.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/squeeze.onnx"));
|
||||
|
||||
// {1, 4, 1, 1, 2}
|
||||
auto input = test::NDArray<float, 5>(
|
||||
|
|
@ -393,7 +393,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_squeeze)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_squeeze_opset13_no_axes)
|
||||
{
|
||||
const auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/squeeze_opset13_no_axes.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/squeeze_opset13_no_axes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
const std::vector<float> data = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f};
|
||||
|
|
@ -405,7 +405,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_squeeze_opset13_no_axes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_unsqueeze)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/unsqueeze.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/unsqueeze.onnx"));
|
||||
|
||||
auto input = test::NDArray<float, 3>(
|
||||
{{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}},
|
||||
|
|
@ -429,7 +429,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_unsqueeze)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_unsqueeze_negative_axes)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/unsqueeze_negative_axes.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/unsqueeze_negative_axes.onnx"));
|
||||
|
||||
auto input = test::NDArray<float, 4>(
|
||||
{{{{-1.8427763f, -1.0467733f, 0.50550157f, 1.4897262f, 0.33057404f}},
|
||||
|
|
@ -453,7 +453,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_unsqueeze_negative_axes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_concat)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/concat.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/concat.onnx"));
|
||||
|
||||
Inputs inputs;
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_concat)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_concat_negative_axis)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/concat_negative_axis.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/concat_negative_axis.onnx"));
|
||||
|
||||
Inputs inputs;
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_concat_negative_axis)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_split_equal_parts_default)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/split_equal_parts_default.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/split_equal_parts_default.onnx"));
|
||||
|
||||
Inputs inputs{{1, 2, 3, 4, 5, 6}};
|
||||
Outputs expected_outputs{{1, 2}, {3, 4}, {5, 6}};
|
||||
|
|
@ -508,7 +508,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_split_equal_parts_2d)
|
|||
{
|
||||
// Split into 2 equal parts along axis=1
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/split_equal_parts_2d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/split_equal_parts_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11});
|
||||
|
|
@ -521,7 +521,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_split_variable_parts_2d)
|
|||
{
|
||||
// Split into variable parts {2, 4} along axis=1
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/split_variable_parts_2d.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/split_variable_parts_2d.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11});
|
||||
|
|
@ -533,7 +533,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_split_variable_parts_2d)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_expand_static_shape)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/expand_static_shape.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/expand_static_shape.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
// input data shape (3,1)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME});
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_default_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_default_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_default_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X
|
||||
|
|
@ -50,7 +50,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_default_const)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_reverse_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_reverse_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_reverse_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X
|
||||
|
|
@ -66,7 +66,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_reverse_const)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_bidir_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_bidir_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X
|
||||
|
|
@ -91,7 +91,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_const)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_clip_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_clip_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X
|
||||
|
|
@ -107,7 +107,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_const)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_mixed_seq_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_mixed_seq_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_mixed_seq_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X
|
||||
|
|
@ -138,7 +138,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_mixed_seq_const)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_reverse_mixed_seq_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_reverse_mixed_seq_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_reverse_mixed_seq_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0.68172926, 1.1405563, -0.03931177, -0.03759607}); // X
|
||||
|
|
@ -169,7 +169,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_reverse_mixed_seq_const)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_mixed_seq_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_bidir_mixed_seq_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_bidir_mixed_seq_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({0.68172926,
|
||||
|
|
@ -223,7 +223,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_mixed_seq_const)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_peepholes)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_with_clip_peepholes.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_with_clip_peepholes.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>({-0.455351, -0.276391, -0.185934, -0.269585}); // X
|
||||
|
|
@ -291,7 +291,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_peepholes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_mixed_seq)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_mixed_seq.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_mixed_seq.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
int hidden_size{3};
|
||||
|
|
@ -330,7 +330,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_mixed_seq)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_hardsigmoid_activation)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_hardsigmoid_activation.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_hardsigmoid_activation.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_hardsigmoid_activation)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_large_batch_no_clip)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_large_batch_no_clip.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_large_batch_no_clip.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -431,7 +431,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_large_batch_no_clip)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_bdir_short_input_seq_peepholes)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_bdir_short_input_seq.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_bdir_short_input_seq.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -491,7 +491,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_bdir_short_input_seq_peepholes)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_mixed_seq_reverse)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_mixed_seq_reverse.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_mixed_seq_reverse.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -536,7 +536,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_mixed_seq_reverse)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_import_only_lstm_dynamic_batch_seq_all_inputs)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/lstm_dyn_batch_seq.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/dynamic_shapes/lstm_dyn_batch_seq.onnx"));
|
||||
|
||||
auto batch_size = Dimension::dynamic();
|
||||
auto seq_length = Dimension::dynamic();
|
||||
|
|
@ -557,7 +557,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_import_only_lstm_dynamic_batch_seq_all_i
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_import_only_lstm_dynamic_batch_seq_3_inputs)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/lstm_dyn_batch_seq_3_inputs.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/lstm_dyn_batch_seq_3_inputs.onnx"));
|
||||
|
||||
auto batch_size = Dimension::dynamic();
|
||||
auto seq_length = Dimension::dynamic();
|
||||
|
|
@ -578,7 +578,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_import_only_lstm_dynamic_batch_seq_3_inp
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_model_lstm_dynamic_batch_size_and_seq_len)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_dynamic_batch_size_and_seq_len.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_dynamic_batch_size_and_seq_len.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>({1, 2, 3, 4, 5, 6});
|
||||
|
|
@ -707,7 +707,7 @@ protected:
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_defaults_fwd_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_defaults_fwd_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_defaults_fwd_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -752,7 +752,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_defaults_fwd_const)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_defaults_fwd)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_defaults_fwd.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_defaults_fwd.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -801,7 +801,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_activations_con
|
|||
{
|
||||
// activations: relu, sigmoid
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/gru_fwd_activations_relu_sigmoid_const.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/gru_fwd_activations_relu_sigmoid_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -843,7 +843,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_activations_rel
|
|||
{
|
||||
// activations: relu, hardsigmoid
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_activations_relu_hardsigmoid.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_activations_relu_hardsigmoid.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -891,7 +891,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_activations_rel
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_mixed_seq_len)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_mixed_seq_len.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_mixed_seq_len.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -942,7 +942,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_mixed_seq_len)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_mixed_seq_len_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_mixed_seq_len_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -985,7 +985,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_mixed_seq_len_c
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse_mixed_seq_len_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_reverse_mixed_seq_len_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_reverse_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1027,7 +1027,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse_mixed_seq_l
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidir_mixed_seq_len_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_bidir_mixed_seq_len_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_bidir_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1072,7 +1072,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidir_mixed_seq_len
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_rev_clip)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_rev_clip.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_rev_clip.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1120,7 +1120,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_rev_clip)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_rev_clip_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_rev_clip_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_rev_clip_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -1165,7 +1165,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_rev_clip_const)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_reverse_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_reverse_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -1210,7 +1210,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse_const)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_reverse.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_reverse.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1258,7 +1258,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_reverse)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_bias_initial_h_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_bias_initial_h_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_bias_initial_h_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -1303,7 +1303,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_bias_initial_h_
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_bias_initial_h)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_bias_initial_h.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_bias_initial_h.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1353,7 +1353,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_bias_initial_h)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidirectional_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_bidirectional_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_bidirectional_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -1399,7 +1399,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidirectional_const
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidirectional)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_bidirectional.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_bidirectional.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1448,7 +1448,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_bidirectional)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_linear_before_reset_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_linear_before_reset_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_linear_before_reset_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -1493,7 +1493,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_linear_before_r
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_linear_before_reset)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_linear_before_reset.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/gru_fwd_linear_before_reset.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1542,7 +1542,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_fwd_linear_before_r
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_defaults_fwd_const_dynamic)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/gru_defaults_fwd_const_dynamic.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/gru_defaults_fwd_const_dynamic.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, in_X);
|
||||
|
|
@ -1587,7 +1587,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_gru_defaults_fwd_const_
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, GRUSequenceOp, onnx_model_import_only_gru_defaults_fwd_const_dynamic)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/gru_defaults_fwd_const_dynamic.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/gru_defaults_fwd_const_dynamic.onnx"));
|
||||
|
||||
auto batch_size = Dimension::dynamic();
|
||||
auto seq_length = Dimension::dynamic();
|
||||
|
|
@ -1694,7 +1694,7 @@ protected:
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_defaults_fwd_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_defaults_fwd_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -1739,7 +1739,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd_const)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_defaults_fwd.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_defaults_fwd.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1787,7 +1787,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_activations_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_activations_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_activations_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1833,7 +1833,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_activations_con
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_activations)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_activations.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_activations.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1881,7 +1881,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_activations)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_mixed_seq_len_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_mixed_seq_len_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -1926,7 +1926,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_mixed_seq_len_c
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_mixed_seq_len)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_mixed_seq_len.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_mixed_seq_len.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -1977,7 +1977,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_mixed_seq_len)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse_mixed_seq_len_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_reverse_mixed_seq_len_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_reverse_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -2018,7 +2018,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse_mixed_seq_l
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidir_mixed_seq_len_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_bidir_mixed_seq_len_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_bidir_mixed_seq_len_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -2065,7 +2065,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidir_mixed_seq_len
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_rev_clip_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_rev_clip_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_rev_clip_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -2110,7 +2110,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_rev_clip_const)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_rev_clip)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_rev_clip.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_rev_clip.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -2158,7 +2158,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_rev_clip)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_reverse_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_reverse_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -2203,7 +2203,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse_const)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_reverse.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_reverse.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -2251,7 +2251,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_reverse)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_bias_initial_h_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_bias_initial_h_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_bias_initial_h_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
test_case.add_input<float>(in_X);
|
||||
|
|
@ -2296,7 +2296,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_bias_initial_h_
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_bias_initial_h)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_bias_initial_h.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_fwd_bias_initial_h.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -2346,7 +2346,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_fwd_bias_initial_h)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidirectional)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_bidirectional.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_bidirectional.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -2395,7 +2395,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidirectional)
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidirectional_const)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_bidirectional_const.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/rnn_bidirectional_const.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine>(function);
|
||||
|
||||
|
|
@ -2442,7 +2442,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_bidirectional_const
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd_const_dynamic)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/rnn_defaults_fwd_const_dynamic.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/rnn_defaults_fwd_const_dynamic.onnx"));
|
||||
|
||||
auto test_case = test::TestCase<TestEngine, test::TestCaseType::DYNAMIC>(function);
|
||||
test_case.add_input<float>(Shape{4, 3, 2}, in_X);
|
||||
|
|
@ -2487,7 +2487,7 @@ NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_rnn_defaults_fwd_const_
|
|||
NGRAPH_TEST_F(${BACKEND_NAME}, RNNSequenceOp, onnx_model_import_only_rnn_defaults_fwd_const_dynamic)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(file_util::path_join(
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/rnn_defaults_fwd_const_dynamic.prototxt"));
|
||||
SERIALIZED_ZOO, "onnx/dynamic_shapes/rnn_defaults_fwd_const_dynamic.onnx"));
|
||||
|
||||
auto batch_size = Dimension::dynamic();
|
||||
auto seq_length = Dimension::dynamic();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME});
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_compress_axis_0)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/compress_0.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/compress_0.onnx")};
|
||||
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_compress_axis_0)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_compress_axis_1)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/compress_1.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/compress_1.onnx")};
|
||||
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_compress_axis_1)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_compress_default_axis)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/compress_default_axis.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/compress_default_axis.onnx")};
|
||||
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_compress_default_axis)
|
|||
NGRAPH_TEST(${BACKEND_NAME}, onnx_compress_negative_axis)
|
||||
{
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/compress_negative_axis.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/compress_negative_axis.onnx")};
|
||||
|
||||
std::map<std::string, std::shared_ptr<ngraph::op::Constant>> in_vals;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ using Outputs = std::vector<std::vector<float>>;
|
|||
NGRAPH_TEST(onnx_tensor_names, simple_model)
|
||||
{
|
||||
auto function = onnx_import::import_onnx_model(
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/tensor_names.prototxt"));
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/tensor_names.onnx"));
|
||||
|
||||
auto ops = function->get_ordered_ops();
|
||||
ASSERT_EQ(ops[0]->get_friendly_name(), "input");
|
||||
|
|
@ -43,7 +43,7 @@ NGRAPH_TEST(onnx_tensor_names, simple_model)
|
|||
NGRAPH_TEST(onnx_tensor_names, node_multiple_outputs)
|
||||
{
|
||||
auto function =
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/top_k.prototxt"));
|
||||
onnx_import::import_onnx_model(file_util::path_join(SERIALIZED_ZOO, "onnx/top_k.onnx"));
|
||||
|
||||
auto ops = function->get_ordered_ops();
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ TYPED_TEST_P(ElemTypesTests, onnx_test_add_abc_set_precission)
|
|||
const element::Type ng_type = element::from<DataType>();
|
||||
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/add_abc_3d.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/add_abc_3d.onnx")};
|
||||
|
||||
editor.set_input_types({{"A", ng_type}, {"B", ng_type}, {"C", ng_type}});
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ TYPED_TEST_P(ElemTypesTests, onnx_test_split_multioutput_set_precission)
|
|||
const element::Type ng_type = element::from<DataType>();
|
||||
|
||||
onnx_editor::ONNXModelEditor editor{
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/split_equal_parts_default.prototxt")};
|
||||
file_util::path_join(SERIALIZED_ZOO, "onnx/split_equal_parts_default.onnx")};
|
||||
|
||||
editor.set_input_types({{"input", ng_type}});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,4 +3,6 @@ paddlepaddle==2.1.0
|
|||
gast==0.3.3
|
||||
numpy~=1.19.2
|
||||
six~=1.15.0
|
||||
|
||||
# ONNX - generate test models
|
||||
docopt~=0.6.2
|
||||
onnx~=1.9.0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# ONNX - generate test models
|
||||
docopt~=0.6.2
|
||||
onnx~=1.9.0
|
||||
protobuf>=3.9
|
||||
|
|
@ -134,11 +134,7 @@ if(NGRAPH_PDPD_FRONTEND_ENABLE OR NGRAPH_ONNX_IMPORT_ENABLE)
|
|||
endif()
|
||||
find_package(Protobuf 3.9.0 REQUIRED)
|
||||
set(Protobuf_LITE_LIBRARIES protobuf::libprotobuf-lite)
|
||||
if(NGRAPH_USE_PROTOBUF_LITE)
|
||||
set(Protobuf_LIBRARIES ${Protobuf_LITE_LIBRARIES})
|
||||
else()
|
||||
set(Protobuf_LIBRARIES protobuf::libprotobuf)
|
||||
endif()
|
||||
set(Protobuf_LIBRARIES protobuf::libprotobuf)
|
||||
set(SYSTEM_PROTOC protobuf::protoc)
|
||||
set(PROTOC_EXECUTABLE ${SYSTEM_PROTOC})
|
||||
|
||||
|
|
|
|||
|
|
@ -55,12 +55,6 @@ set(Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/src)
|
|||
# to hide libprotobuf warnings
|
||||
target_include_directories(libprotobuf-lite SYSTEM PRIVATE "${Protobuf_INCLUDE_DIRS}")
|
||||
|
||||
if(NGRAPH_USE_PROTOBUF_LITE)
|
||||
set(Protobuf_LIBRARIES libprotobuf-lite)
|
||||
else()
|
||||
set(Protobuf_LIBRARIES libprotobuf)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR
|
||||
CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
if(protobuf_BUILD_PROTOC_BINARIES)
|
||||
|
|
@ -104,5 +98,5 @@ endif()
|
|||
|
||||
set(protobuf_VERSION ${protobuf_VERSION} PARENT_SCOPE)
|
||||
set(Protobuf_LITE_LIBRARIES libprotobuf-lite PARENT_SCOPE)
|
||||
set(Protobuf_LIBRARIES ${Protobuf_LIBRARIES} PARENT_SCOPE)
|
||||
set(Protobuf_LIBRARIES libprotobuf-lite PARENT_SCOPE)
|
||||
set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIRS} PARENT_SCOPE)
|
||||
|
|
|
|||
Loading…
Reference in New Issue