Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
7654df0d93
358 files changed
+6842
-16527
No files matched your search
@@ -96,9 +96,7 @@ jobs:
|
||||
-DENABLE_SPEECH_DEMO=OFF
|
||||
-DNGRAPH_ONNX_IMPORT_ENABLE=ON
|
||||
-DNGRAPH_ONNX_EDITOR_ENABLE=ON
|
||||
-DNGRAPH_INTERPRETER_ENABLE=ON
|
||||
-DNGRAPH_DEBUG_ENABLE=OFF
|
||||
-DNGRAPH_DYNAMIC_COMPONENTS_ENABLE=ON
|
||||
$(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ jobs:
|
||||
- script: |
|
||||
set PATH=$(TEST_ENV_PATH)
|
||||
rem $(BIN_DIR)\cpuFuncTests.exe --gtest_filter=*smoke* --gtest_output=xml:TEST-cpuFuncTests.xml
|
||||
"$(IB_TESTCONSOLE)" $(BIN_DIR)\cpuFuncTests.exe --gtest_filter=*smoke*:-*CompareWithRefs/base_size=16_pre_nms_topn=100_post_nms_topn=100_nms_thresh=0.7_feat_stride=1_min_size=1_ratio* --gtest_output=xml:TEST-cpuFuncTests-IB.xml /testlevel=24
|
||||
"$(IB_TESTCONSOLE)" $(BIN_DIR)\cpuFuncTests.exe --gtest_filter=*smoke*:-*CompareWithRefs/base_size=16_pre_nms_topn=100_post_nms_topn=100_nms_thresh=0.7_feat_stride=1_min_size=1_ratio*:*smoke_GRUSequenceCommonZeroClip/GRUSequenceTest.CompareWithRefs/mode=CONVERT_TO_TI_MAX_SEQ_LEN_CONST_seq_lengths* --gtest_output=xml:TEST-cpuFuncTests-IB.xml /testlevel=24
|
||||
displayName: 'CPU FuncTests - IB'
|
||||
continueOnError: false
|
||||
|
||||
|
||||
@@ -70,9 +70,7 @@ RUN cmake .. \
|
||||
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
|
||||
-DNGRAPH_ONNX_IMPORT_ENABLE=ON \
|
||||
-DNGRAPH_ONNX_EDITOR_ENABLE=ON \
|
||||
-DNGRAPH_INTERPRETER_ENABLE=ON \
|
||||
-DNGRAPH_DEBUG_ENABLE=OFF \
|
||||
-DNGRAPH_DYNAMIC_COMPONENTS_ENABLE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=/openvino/dist \
|
||||
-DNGRAPH_USE_PROTOBUF_LITE=${PROTOBUF_LITE}
|
||||
RUN make -j $(nproc) install
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
path = thirdparty/zlib/zlib
|
||||
url = https://github.com/madler/zlib.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/pugixml"]
|
||||
path = thirdparty/pugixml
|
||||
url = https://github.com/zeux/pugixml.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/ade"]
|
||||
path = thirdparty/ade
|
||||
url = https://github.com/opencv/ade.git
|
||||
@@ -25,9 +29,12 @@
|
||||
[submodule "thirdparty/ocl/icd_loader"]
|
||||
path = thirdparty/ocl/icd_loader
|
||||
url = https://github.com/KhronosGroup/OpenCL-ICD-Loader.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/ocl/cl_headers"]
|
||||
path = thirdparty/ocl/cl_headers
|
||||
url = https://github.com/KhronosGroup/OpenCL-Headers.git
|
||||
ignore = dirty
|
||||
[submodule "thirdparty/ocl/clhpp_headers"]
|
||||
path = thirdparty/ocl/clhpp_headers
|
||||
url = https://github.com/KhronosGroup/OpenCL-CLHPP.git
|
||||
ignore = dirty
|
||||
+11
-69
@@ -4,13 +4,12 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
project(OpenVINO)
|
||||
project(OpenVINO DESCRIPTION "OpenVINO toolkit")
|
||||
|
||||
set(OpenVINO_MAIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(IE_MAIN_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine)
|
||||
set(IE_MAIN_SOURCE_DIR ${OpenVINO_SOURCE_DIR}/inference-engine)
|
||||
|
||||
find_package(IEDevScripts REQUIRED
|
||||
PATHS "${OpenVINO_MAIN_SOURCE_DIR}/cmake/developer_package"
|
||||
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
@@ -27,8 +26,7 @@ endif()
|
||||
# resolving dependencies for the project
|
||||
message (STATUS "PROJECT ............................... " ${PROJECT_NAME})
|
||||
message (STATUS "CMAKE_BINARY_DIR ...................... " ${CMAKE_BINARY_DIR})
|
||||
message (STATUS "OpenVINO_MAIN_SOURCE_DIR .............. " ${OpenVINO_MAIN_SOURCE_DIR})
|
||||
message (STATUS "IE_MAIN_SOURCE_DIR .................... " ${IE_MAIN_SOURCE_DIR})
|
||||
message (STATUS "OpenVINO_SOURCE_DIR .... .......... " ${OpenVINO_SOURCE_DIR})
|
||||
message (STATUS "CMAKE_GENERATOR ....................... " ${CMAKE_GENERATOR})
|
||||
message (STATUS "CMAKE_C_COMPILER_ID ................... " ${CMAKE_C_COMPILER_ID})
|
||||
message (STATUS "CMAKE_BUILD_TYPE ...................... " ${CMAKE_BUILD_TYPE})
|
||||
@@ -64,7 +62,6 @@ function(build_ngraph)
|
||||
ngraph_set(NGRAPH_ONNX_IMPORT_ENABLE OFF)
|
||||
ngraph_set(NGRAPH_PDPD_FRONTEND_ENABLE OFF)
|
||||
endif()
|
||||
ngraph_set(NGRAPH_INTERPRETER_ENABLE ON)
|
||||
|
||||
if(ENABLE_PYTHON)
|
||||
ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE ON)
|
||||
@@ -93,7 +90,6 @@ function(build_ngraph)
|
||||
ie_cpack_add_component(ngraph_dev REQUIRED DEPENDS ngraph)
|
||||
|
||||
add_subdirectory(ngraph)
|
||||
set(NGRAPH_LIBRARIES ngraph PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(openvino_developer_export_targets)
|
||||
@@ -132,72 +128,18 @@ add_subdirectory(thirdparty)
|
||||
add_subdirectory(openvino)
|
||||
build_ngraph()
|
||||
add_subdirectory(inference-engine)
|
||||
|
||||
# for Template plugin
|
||||
openvino_developer_export_targets(COMPONENT ngraph TARGETS ngraph_backend interpreter_backend)
|
||||
include(cmake/extra_modules.cmake)
|
||||
|
||||
add_subdirectory(model-optimizer)
|
||||
add_subdirectory(docs)
|
||||
add_subdirectory(tools)
|
||||
add_subdirectory(scripts)
|
||||
|
||||
#
|
||||
# Shellcheck
|
||||
# CPack
|
||||
#
|
||||
|
||||
ie_shellcheck_process(DIRECTORY "${OpenVINO_MAIN_SOURCE_DIR}"
|
||||
SKIP "${OpenVINO_MAIN_SOURCE_DIR}/bin"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/build"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/thirdparty"
|
||||
"${IE_MAIN_SOURCE_DIR}/tests/ie_test_utils/common_test_utils/gtest"
|
||||
"${IE_MAIN_SOURCE_DIR}/samples/thirdparty"
|
||||
"${IE_MAIN_SOURCE_DIR}/thirdparty"
|
||||
"${IE_MAIN_SOURCE_DIR}/temp"
|
||||
# TODO fix and enable back:
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/scripts/dependencies.sh"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/scripts/install_dependencies/install_NEO_OCL_driver.sh"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/scripts/install_dependencies/install_openvino_dependencies.sh"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/ngraph/python/tests/test_onnx/model_zoo_preprocess.sh"
|
||||
)
|
||||
|
||||
#
|
||||
# cpack
|
||||
#
|
||||
|
||||
# install setupvars
|
||||
|
||||
ie_cpack_add_component(setupvars REQUIRED)
|
||||
|
||||
if(UNIX)
|
||||
install(PROGRAMS scripts/setupvars/setupvars.sh
|
||||
DESTINATION bin
|
||||
COMPONENT setupvars)
|
||||
elseif(WIN32)
|
||||
install(PROGRAMS scripts/setupvars/setupvars.bat
|
||||
DESTINATION bin
|
||||
COMPONENT setupvars)
|
||||
endif()
|
||||
|
||||
# install install_dependencies
|
||||
|
||||
if(UNIX)
|
||||
ie_cpack_add_component(install_dependencies REQUIRED)
|
||||
install(DIRECTORY scripts/install_dependencies/
|
||||
DESTINATION install_dependencies
|
||||
COMPONENT install_dependencies)
|
||||
endif()
|
||||
|
||||
# install files for demo
|
||||
|
||||
ie_cpack_add_component(demo_scripts DEPENDS core)
|
||||
|
||||
if(UNIX)
|
||||
install(DIRECTORY scripts/demo/
|
||||
DESTINATION deployment_tools/demo
|
||||
COMPONENT demo_scripts
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN *.bat EXCLUDE)
|
||||
elseif(WIN32)
|
||||
install(DIRECTORY scripts/demo/
|
||||
DESTINATION deployment_tools/demo
|
||||
COMPONENT demo_scripts
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN *.sh EXCLUDE)
|
||||
endif()
|
||||
|
||||
ie_cpack(${IE_CPACK_COMPONENTS_ALL})
|
||||
@@ -2,7 +2,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(OV_COVERAGE_BASE_DIRECTORY "${OpenVINO_MAIN_SOURCE_DIR}")
|
||||
set(OV_COVERAGE_BASE_DIRECTORY "${OpenVINO_SOURCE_DIR}")
|
||||
|
||||
ie_coverage_clean(REPOSITORY "openvino"
|
||||
DIRECTORY "${OV_COVERAGE_GCDA_DATA_DIRECTORY}")
|
||||
|
||||
@@ -121,10 +121,10 @@ endif()
|
||||
|
||||
# allow to override default OUTPUT_ROOT root
|
||||
if(NOT DEFINED OUTPUT_ROOT)
|
||||
if(NOT DEFINED OpenVINO_MAIN_SOURCE_DIR)
|
||||
message(FATAL_ERROR "OpenVINO_MAIN_SOURCE_DIR is not defined")
|
||||
if(NOT DEFINED OpenVINO_SOURCE_DIR)
|
||||
message(FATAL_ERROR "OpenVINO_SOURCE_DIR is not defined")
|
||||
endif()
|
||||
set(OUTPUT_ROOT ${OpenVINO_MAIN_SOURCE_DIR})
|
||||
set(OUTPUT_ROOT ${OpenVINO_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
# Enable postfixes for Debug/Release builds
|
||||
|
||||
@@ -20,8 +20,6 @@ addIeTarget(
|
||||
/some/specific/path
|
||||
LINK_LIBRARIES
|
||||
ie::important_plugin
|
||||
EXPORT_DEPENDENCIES
|
||||
dependency_lib_to_export
|
||||
DEPENDENCIES
|
||||
dependencies
|
||||
OBJECT_FILES
|
||||
@@ -51,7 +49,6 @@ function(addIeTarget)
|
||||
EXCLUDED_SOURCE_PATHS # list of paths excluded from the global recursive search of source files
|
||||
LINK_LIBRARIES_WHOLE_ARCHIVE # list of static libraries to link, each object file should be used and not discarded
|
||||
LINK_FLAGS # list of extra commands to linker
|
||||
EXPORT_DEPENDENCIES # list of the dependencies to be exported with the target through the developer package
|
||||
)
|
||||
cmake_parse_arguments(ARG "${options}" "${oneValueRequiredArgs};${oneValueOptionalArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
@@ -127,7 +124,7 @@ function(addIeTarget)
|
||||
if (ARG_DEVELOPER_PACKAGE)
|
||||
# developer package
|
||||
openvino_developer_export_targets(COMPONENT ${ARG_DEVELOPER_PACKAGE}
|
||||
TARGETS ${ARG_NAME} ${ARG_EXPORT_DEPENDENCIES})
|
||||
TARGETS ${ARG_NAME})
|
||||
endif()
|
||||
if(WIN32)
|
||||
# Provide default compile pdb name equal to target name
|
||||
|
||||
@@ -67,15 +67,15 @@ function(ie_sse42_optimization_flags flags)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# No such option for MSVC 2019
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} "/arch:SSE4.2 /QxSSE4.2" PARENT_SCOPE)
|
||||
set(${flags} /arch:SSE4.2 /QxSSE4.2 PARENT_SCOPE)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} "-msse4.2 -xSSE4.2" PARENT_SCOPE)
|
||||
set(${flags} -msse4.2 -xSSE4.2 PARENT_SCOPE)
|
||||
else()
|
||||
set(${flags} "-msse4.2" PARENT_SCOPE)
|
||||
set(${flags} -msse4.2 PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -86,17 +86,17 @@ endfunction()
|
||||
function(ie_avx2_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} "/QxCORE-AVX2" PARENT_SCOPE)
|
||||
set(${flags} /QxCORE-AVX2 PARENT_SCOPE)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(${flags} "/arch:AVX2" PARENT_SCOPE)
|
||||
set(${flags} /arch:AVX2 PARENT_SCOPE)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} "-march=core-avx2 -xCORE-AVX2 -mtune=core-avx2" PARENT_SCOPE)
|
||||
set(${flags} -march=core-avx2 -xCORE-AVX2 -mtune=core-avx2 PARENT_SCOPE)
|
||||
else()
|
||||
set(${flags} "-mavx2 -mfma" PARENT_SCOPE)
|
||||
set(${flags} -mavx2 -mfma PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -108,21 +108,21 @@ endfunction()
|
||||
function(ie_avx512_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} "/QxCOMMON-AVX512" PARENT_SCOPE)
|
||||
set(${flags} /QxCOMMON-AVX512 PARENT_SCOPE)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(${flags} "/arch:AVX512" PARENT_SCOPE)
|
||||
set(${flags} /arch:AVX512 PARENT_SCOPE)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} "-xCOMMON-AVX512" PARENT_SCOPE)
|
||||
set(${flags} -xCOMMON-AVX512 PARENT_SCOPE)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(${flags} "-mavx512f -mfma" PARENT_SCOPE)
|
||||
set(${flags} -mavx512f -mfma PARENT_SCOPE)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|AppleClang)$")
|
||||
set(${flags} "-mavx512f -mfma" PARENT_SCOPE)
|
||||
set(${flags} -mavx512f -mfma PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -134,19 +134,19 @@ function(ie_arm_neon_optimization_flags flags)
|
||||
# nothing
|
||||
elseif(ANDROID)
|
||||
if(ANDROID_ABI STREQUAL "arm64-v8a")
|
||||
set(${flags} "-mfpu=neon" PARENT_SCOPE)
|
||||
set(${flags} -mfpu=neon PARENT_SCOPE)
|
||||
elseif(ANDROID_ABI STREQUAL "armeabi-v7a-hard with NEON")
|
||||
set(${flags} "-march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon" PARENT_SCOPE)
|
||||
set(${flags} -march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon PARENT_SCOPE)
|
||||
elseif((ANDROID_ABI STREQUAL "armeabi-v7a with NEON") OR
|
||||
(ANDROID_ABI STREQUAL "armeabi-v7a" AND
|
||||
DEFINED CMAKE_ANDROID_ARM_NEON AND CMAKE_ANDROID_ARM_NEON))
|
||||
set(${flags} "-march=armv7-a -mfloat-abi=softfp -mfpu=neon" PARENT_SCOPE)
|
||||
set(${flags} -march=armv7-a -mfloat-abi=softfp -mfpu=neon PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
if(AARCH64)
|
||||
set(${flags} "-O2 -ftree-vectorize" PARENT_SCOPE)
|
||||
set(${flags} -O2 -ftree-vectorize PARENT_SCOPE)
|
||||
elseif(ARM)
|
||||
set(${flags} "-mfpu=neon" PARENT_SCOPE)
|
||||
set(${flags} -mfpu=neon PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -120,8 +120,8 @@ function(_clone_source_to_target TARGET SOURCE ARCH_SET)
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
set_property(SOURCE ${ARCH_SOURCE} APPEND_STRING PROPERTY COMPILE_FLAGS
|
||||
" ${_FLAGS_${_arch}}")
|
||||
set_property(SOURCE ${ARCH_SOURCE} APPEND_STRING PROPERTY COMPILE_OPTIONS
|
||||
"${_FLAGS_${_arch}}")
|
||||
|
||||
set_property(SOURCE ${ARCH_SOURCE} APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
${_DEFINE_${_arch}}
|
||||
|
||||
@@ -25,15 +25,8 @@ function (resolve_archive_dependency VAR COMPONENT ARCHIVE ARCHIVE_UNIFIED ARCHI
|
||||
set (${VAR} $ENV{${ENVIRONMENT}} PARENT_SCOPE)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
endfunction(resolve_archive_dependency)
|
||||
|
||||
function(resolve_pull_request GITHUB_PULL_REQUEST TARGET_PATH)
|
||||
get_filename_component(FILE_NAME ${GITHUB_PULL_REQUEST} NAME)
|
||||
set (PATCH_URL "")
|
||||
DownloadAndApply("${PATCH_URL}/${GITHUB_PULL_REQUEST}" "${IE_MAIN_SOURCE_DIR}/${TARGET_PATH}/${FILE_NAME}")
|
||||
endfunction(resolve_pull_request)
|
||||
|
||||
function(extract_version_from_filename filename regex version)
|
||||
string(REGEX MATCH ${regex} match ${filename})
|
||||
|
||||
@@ -51,10 +44,8 @@ function(read_version archive regex version_var)
|
||||
endfunction(read_version)
|
||||
|
||||
function (RESOLVE_DEPENDENCY NAME_OF_CMAKE_VAR)
|
||||
|
||||
list(REMOVE_AT ARGV 0)
|
||||
set(SUPPORTED_ARGS FOLDER ARCHIVE ARCHIVE_UNIFIED ARCHIVE_WIN ARCHIVE_LIN ARCHIVE_MAC ARCHIVE_ANDROID TARGET_PATH ENVIRONMENT GITHUB_PULL_REQUEST VERSION_REGEX SHA256 FILES_TO_EXTRACT)
|
||||
|
||||
set(SUPPORTED_ARGS FOLDER ARCHIVE ARCHIVE_UNIFIED ARCHIVE_WIN ARCHIVE_LIN ARCHIVE_MAC ARCHIVE_ANDROID TARGET_PATH ENVIRONMENT VERSION_REGEX SHA256 FILES_TO_EXTRACT)
|
||||
|
||||
#unnecessary vars
|
||||
foreach(arg ${ARGV})
|
||||
@@ -134,11 +125,8 @@ function (RESOLVE_DEPENDENCY NAME_OF_CMAKE_VAR)
|
||||
read_version(${archive} ${VERSION_REGEX} "${NAME_OF_CMAKE_VAR}_VERSION")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
elseif (DEFINED GITHUB_PULL_REQUEST)
|
||||
resolve_pull_request(${GITHUB_PULL_REQUEST} ${TARGET_PATH})
|
||||
else()
|
||||
message(FATAL_ERROR "Dependency of unknowntype, SHOULD set one of ARCHIVE_WIN, ARCHIVE, ARCHIVE_LIN, ARCHIVE_MAC, ARCHIVE_ANDROID, GITHUB_PULL_REQUEST")
|
||||
message(FATAL_ERROR "Dependency of unknowntype, SHOULD set one of ARCHIVE_WIN, ARCHIVE, ARCHIVE_LIN, ARCHIVE_MAC, ARCHIVE_ANDROID")
|
||||
endif()
|
||||
|
||||
endfunction(RESOLVE_DEPENDENCY)
|
||||
|
||||
@@ -42,7 +42,7 @@ macro(ie_parse_ci_build_number)
|
||||
message(FATAL_ERROR "repo_root is not defined")
|
||||
endif()
|
||||
|
||||
if(DEFINED IEDevScripts_DIR AND DEFINED IE_MAIN_SOURCE_DIR AND NOT DEFINED custom_build)
|
||||
if(DEFINED IEDevScripts_DIR AND DEFINED OpeenVINO_SOURCE_DIR AND NOT DEFINED custom_build)
|
||||
set(ie_version_hpp "${IE_MAIN_SOURCE_DIR}/include/ie_version.hpp")
|
||||
if(NOT EXISTS ${ie_version_hpp})
|
||||
message(FATAL_ERROR "File ie_version.hpp with IE_VERSION definitions is not found")
|
||||
@@ -67,7 +67,7 @@ macro(ie_parse_ci_build_number)
|
||||
endif()
|
||||
endforeach()
|
||||
elseif(has_ci_version)
|
||||
message(WARNING "IE_MAIN_SOURCE_DIR is not defined. No way to compare versions")
|
||||
message(WARNING "OpeenVINO_SOURCE_DIR is not defined. No way to compare versions")
|
||||
else()
|
||||
message(WARNING "No way to detect OpenVINO version. Supposing 0.0.0.0")
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
|
||||
function(ie_generate_dev_package_config)
|
||||
# dummy check that OpenCV is here
|
||||
find_package(OpenCV QUIET)
|
||||
|
||||
set(all_dev_targets gflags ie_libraries)
|
||||
foreach(component IN LISTS openvino_export_components)
|
||||
export(TARGETS ${${component}} NAMESPACE IE::
|
||||
APPEND FILE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
|
||||
list(APPEND all_dev_targets ${${component}})
|
||||
endforeach()
|
||||
add_custom_target(ie_dev_targets ALL DEPENDS ${all_dev_targets})
|
||||
|
||||
configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig.cmake"
|
||||
INSTALL_DESTINATION share # not used
|
||||
PATH_VARS "OpenVINO_SOURCE_DIR;gflags_BINARY_DIR"
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
|
||||
|
||||
configure_file("${OpenVINO_SOURCE_DIR}/cmake/templates/InferenceEngineConfig-version.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig-version.cmake"
|
||||
@ONLY)
|
||||
endfunction()
|
||||
|
||||
ie_generate_dev_package_config()
|
||||
|
||||
#
|
||||
# Add extra modules
|
||||
#
|
||||
|
||||
function(register_extra_modules)
|
||||
# post export
|
||||
openvino_developer_export_targets(COMPONENT inference_engine TARGETS inference_engine)
|
||||
openvino_developer_export_targets(COMPONENT ngraph TARGETS ngraph)
|
||||
|
||||
set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/runtime")
|
||||
|
||||
function(generate_fake_dev_package)
|
||||
set(iedevconfig_file "${InferenceEngineDeveloperPackage_DIR}/InferenceEngineDeveloperPackageConfig.cmake")
|
||||
file(REMOVE "${iedevconfig_file}")
|
||||
|
||||
file(WRITE "${iedevconfig_file}" "\# !! AUTOGENERATED: DON'T EDIT !!\n\n")
|
||||
file(APPEND "${iedevconfig_file}" "ie_deprecated_no_errors()\n")
|
||||
|
||||
foreach(target IN LISTS ${openvino_export_components})
|
||||
if(target)
|
||||
file(APPEND "${iedevconfig_file}" "add_library(IE::${target} ALIAS ${target})\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
generate_fake_dev_package()
|
||||
|
||||
# automatically import plugins from the 'plugins' folder
|
||||
file(GLOB local_extra_modules "runtime/plugins/*")
|
||||
# add template plugin
|
||||
list(APPEND local_extra_modules "${OpenVINO_SOURCE_DIR}/docs/template_plugin")
|
||||
|
||||
# detect where IE_EXTRA_MODULES contains folders with CMakeLists.txt
|
||||
# other folders are supposed to have sub-folders with CMakeLists.txt
|
||||
foreach(module_path IN LISTS IE_EXTRA_MODULES)
|
||||
if(EXISTS "${module_path}/CMakeLists.txt")
|
||||
list(APPEND extra_modules "${module_path}")
|
||||
elseif(module_path)
|
||||
file(GLOB extra_modules ${extra_modules} "${module_path}/*")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# add each extra module
|
||||
foreach(module_path IN LISTS extra_modules local_extra_modules)
|
||||
if(module_path)
|
||||
get_filename_component(module_name "${module_path}" NAME)
|
||||
set(build_module ON)
|
||||
if(NOT EXISTS "${module_path}/CMakeLists.txt") # if module is built not using cmake
|
||||
set(build_module OFF)
|
||||
endif()
|
||||
if(NOT DEFINED BUILD_${module_name})
|
||||
set(BUILD_${module_name} ${build_module} CACHE BOOL "Build ${module_name} extra module" FORCE)
|
||||
endif()
|
||||
if(BUILD_${module_name})
|
||||
message(STATUS "Register ${module_name} to be built in build-modules/${module_name}")
|
||||
add_subdirectory("${module_path}" "build-modules/${module_name}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
register_extra_modules()
|
||||
@@ -40,6 +40,8 @@ ie_dependent_option (ENABLE_PYTHON "enables ie python bridge build" OFF "PYTHONL
|
||||
find_package(PythonInterp 3 QUIET)
|
||||
ie_dependent_option (ENABLE_DOCS "Build docs using Doxygen" OFF "PYTHONINTERP_FOUND" OFF)
|
||||
|
||||
ie_option (ENABLE_SYSTEM_PUGIXML "use the system copy of pugixml" OFF)
|
||||
|
||||
#
|
||||
# Inference Engine specific options
|
||||
#
|
||||
@@ -110,7 +112,7 @@ set(IE_EXTRA_MODULES "" CACHE STRING "Extra paths for extra modules to include i
|
||||
|
||||
ie_dependent_option(ENABLE_TBB_RELEASE_ONLY "Only Release TBB libraries are linked to the Inference Engine binaries" ON "THREADING MATCHES TBB;LINUX" OFF)
|
||||
|
||||
ie_option (USE_SYSTEM_PUGIXML "use the system copy of pugixml" OFF)
|
||||
ie_option (ENABLE_SYSTEM_PUGIXML "use the system copy of pugixml" OFF)
|
||||
|
||||
ie_option (ENABLE_CPU_DEBUG_CAPS "enable CPU debug capabilities at runtime" OFF)
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# TODO: remove after changing [private plugins]
|
||||
set_and_check(OpenVINO_MAIN_SOURCE_DIR "@OpenVINO_MAIN_SOURCE_DIR@") # KMB
|
||||
set_and_check(OpenVINO_SOURCE_DIR "@OpenVINO_SOURCE_DIR@") # KMB
|
||||
set_and_check(OpenVINO_MAIN_SOURCE_DIR "@OpenVINO_SOURCE_DIR@") # KMB
|
||||
set_and_check(IE_MAIN_SOURCE_DIR "@IE_MAIN_SOURCE_DIR@") # HDDL
|
||||
|
||||
# Variables to export in plugin's projects
|
||||
@@ -33,7 +34,7 @@ set_and_check(gflags_DIR "@gflags_BINARY_DIR@")
|
||||
#
|
||||
|
||||
find_dependency(IEDevScripts
|
||||
PATHS "${OpenVINO_MAIN_SOURCE_DIR}/cmake/developer_package"
|
||||
PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package"
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
@@ -51,9 +52,10 @@ foreach(component @openvino_export_components@)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/${component}_dev_targets.cmake")
|
||||
endforeach()
|
||||
|
||||
if(USE_SYSTEM_PUGIXML)
|
||||
if(ENABLE_SYSTEM_PUGIXML)
|
||||
find_dependency(PugiXML)
|
||||
set_property(TARGET pugixml PROPERTY IMPORTED_GLOBAL TRUE)
|
||||
add_library(IE::pugixml ALIAS pugixml)
|
||||
endif()
|
||||
|
||||
# inherit OpenCV from main IE project if enabled
|
||||
|
||||
+25
-29
@@ -46,10 +46,6 @@ if(NOT ENABLE_DOCKER)
|
||||
|
||||
install(TARGETS templatePlugin template_extension
|
||||
LIBRARY DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
if(ENABLE_FUNCTIONAL_TESTS)
|
||||
install(TARGETS templateFuncTests
|
||||
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(LINKCHECKER_PY "" CACHE FILEPATH "Path to linkchecker.py for documentation check")
|
||||
@@ -74,13 +70,13 @@ function(build_docs)
|
||||
endif()
|
||||
|
||||
set(DOCS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(DOXYGEN_DIR "${OpenVINO_MAIN_SOURCE_DIR}/docs/doxygen")
|
||||
set(IE_SOURCE_DIR "${OpenVINO_MAIN_SOURCE_DIR}/inference-engine")
|
||||
set(DOXYGEN_DIR "${OpenVINO_SOURCE_DIR}/docs/doxygen")
|
||||
set(IE_SOURCE_DIR "${OpenVINO_SOURCE_DIR}/inference-engine")
|
||||
set(PYTHON_API_IN "${IE_SOURCE_DIR}/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx")
|
||||
set(PYTHON_API_OUT "${DOCS_BUILD_DIR}/python_api/ie_api.pyx")
|
||||
set(C_API "${IE_SOURCE_DIR}/ie_bridges/c/include")
|
||||
set(PLUGIN_API_DIR "${DOCS_BUILD_DIR}/IE_PLUGIN_DG")
|
||||
set(NGRAPH_DIR "${OpenVINO_MAIN_SOURCE_DIR}/ngraph")
|
||||
set(NGRAPH_DIR "${OpenVINO_SOURCE_DIR}/ngraph")
|
||||
set(NGRAPH_PY_DIR "${NGRAPH_DIR}/python/src/ngraph/")
|
||||
set(NGRAPH_CPP_DIR "${NGRAPH_DIR}/core/include/" "${NGRAPH_DIR}/frontend/onnx_import/include")
|
||||
|
||||
@@ -103,17 +99,17 @@ function(build_docs)
|
||||
configure_file(${FOOTER_SOURCE} ${FOOTER_BUILD} @ONLY)
|
||||
|
||||
file(GLOB_RECURSE doc_source_files
|
||||
LIST_DIRECTORIES true RELATIVE ${OpenVINO_MAIN_SOURCE_DIR}
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.md"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.png"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.gif"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.jpg"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.svg"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.md"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.png"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.gif"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.jpg"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.svg")
|
||||
LIST_DIRECTORIES true RELATIVE ${OpenVINO_SOURCE_DIR}
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.md"
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.png"
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.gif"
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.jpg"
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.svg"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.md"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.png"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.gif"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.jpg"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.svg")
|
||||
|
||||
configure_file(${PYTHON_API_IN} ${PYTHON_API_OUT} @ONLY)
|
||||
|
||||
@@ -224,19 +220,19 @@ function(build_docs)
|
||||
|
||||
# ovino doc files
|
||||
file(GLOB_RECURSE ovino_doc_files
|
||||
LIST_DIRECTORIES true RELATIVE ${OpenVINO_MAIN_SOURCE_DIR}
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.md"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.png"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.gif"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/docs/*.jpg"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.md"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.png"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.gif"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.jpg")
|
||||
LIST_DIRECTORIES true RELATIVE ${OpenVINO_SOURCE_DIR}
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.md"
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.png"
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.gif"
|
||||
"${OpenVINO_SOURCE_DIR}/docs/*.jpg"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.md"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.png"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.gif"
|
||||
"${OpenVINO_SOURCE_DIR}/inference-engine/*.jpg")
|
||||
|
||||
foreach(source_file ${ovino_doc_files})
|
||||
list(APPEND commands COMMAND ${CMAKE_COMMAND} -E copy
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/${source_file}" "${DOCS_BUILD_DIR}/openvino/${source_file}")
|
||||
"${OpenVINO_SOURCE_DIR}/${source_file}" "${DOCS_BUILD_DIR}/openvino/${source_file}")
|
||||
endforeach()
|
||||
|
||||
# omz doc files
|
||||
@@ -371,7 +367,7 @@ function(build_docs)
|
||||
find_program(browser NAMES xdg-open)
|
||||
if(browser)
|
||||
add_custom_target(ie_docs_open
|
||||
COMMAND ${browser} "${OpenVINO_MAIN_SOURCE_DIR}/docs/html/index.html"
|
||||
COMMAND ${browser} "${OpenVINO_SOURCE_DIR}/docs/html/index.html"
|
||||
DEPENDS ie_docs
|
||||
COMMENT "Open OpenVINO documentation"
|
||||
VERBATIM)
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:26ff5d3d42b9838a14481425af8fe8aed791b26fc00a062b91128ba9d5528549
|
||||
size 743788
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9858dbc95426c44d8f11a86936f586ebf4f1d0b8c88ba389d9f89c2948f58ea3
|
||||
size 62051
|
||||
@@ -209,9 +209,135 @@ Decsriptions can be found in [Samples Overview](./Samples_Overview.md)
|
||||
[state_network_example]: ./img/state_network_example.png
|
||||
|
||||
|
||||
## LowLatency Transformation
|
||||
## LowLatency Transformations
|
||||
|
||||
If the original framework does not have a special API for working with states, after importing the model, OpenVINO representation will not contain Assign/ReadValue layers. For example, if the original ONNX model contains RNN operations, IR will contain TensorIterator operations and the values will be obtained only after the execution of whole TensorIterator primitive, intermediate values from each iteration will not be available. To be able to work with these intermediate values of each iteration and receive them with a low latency after each infer request, a special LowLatency transformation was introduced.
|
||||
If the original framework does not have a special API for working with states, after importing the model, OpenVINO representation will not contain Assign/ReadValue layers. For example, if the original ONNX model contains RNN operations, IR will contain TensorIterator operations and the values will be obtained only after execution of the whole TensorIterator primitive. Intermediate values from each iteration will not be available. To enable you to work with these intermediate values of each iteration and receive them with a low latency after each infer request, special LowLatency and LowLatency2 transformations were introduced.
|
||||
|
||||
### How to get TensorIterator/Loop operaions from different frameworks via ModelOptimizer.
|
||||
|
||||
**ONNX and frameworks supported via ONNX format:** *LSTM, RNN, GRU* original layers are converted to the TensorIterator operation. TensorIterator body contains LSTM/RNN/GRU Cell. Peepholes, InputForget modifications are not supported, sequence_lengths optional input is supported.
|
||||
*ONNX Loop* layer is converted to the OpenVINO Loop operation.
|
||||
|
||||
**MXNet:** *LSTM, RNN, GRU* original layers are converted to TensorIterator operation, TensorIterator body contains LSTM/RNN/GRU Cell operations.
|
||||
|
||||
**TensorFlow:** *BlockLSTM* is converted to TensorIterator operation, TensorIterator body contains LSTM Cell operation, Peepholes, InputForget modifications are not supported.
|
||||
*While* layer is converted to TensorIterator, TensorIterator body can contain any supported operations, but dynamic cases, when count of iterations cannot be calculated in shape inference (ModelOptimizer conversion) time, are not supported.
|
||||
|
||||
**TensorFlow2:** *While* layer is converted to Loop operation. Loop body can contain any supported operations.
|
||||
|
||||
**Kaldi:** Kaldi models already contain Assign/ReadValue (Memory) operations after model conversion. TensorIterator/Loop operations are not generated.
|
||||
|
||||
## LowLatencу2
|
||||
|
||||
LowLatency2 transformation changes the structure of the network containing [TensorIterator](../ops/infrastructure/TensorIterator_1.md) and [Loop](../ops/infrastructure/Loop_5.md) by adding the ability to work with the state, inserting the Assign/ReadValue layers as it is shown in the picture below.
|
||||
|
||||
### The differences between LowLatency and LowLatency2**:
|
||||
|
||||
* Unrolling of TensorIterator/Loop operations became a part of LowLatency2, not a separate transformation. After invoking the transformation, the network can be serialized and inferred without re-invoking the transformation.
|
||||
* Added support for TensorIterator and Loop operations with multiple iterations inside. TensorIterator/Loop will not be unrolled in this case.
|
||||
* Resolved the ‘Parameters connected directly to ReadValues’ limitation. To apply the previous version of the transformation in this case, additional manual manipulations were required, now the case is processed automatically.
|
||||
#### Example of applying LowLatency2 transformation:
|
||||

|
||||
|
||||
After applying the transformation, ReadValue operations can receive other operations as an input, as shown in the picture above. These inputs should set the initial value for initialization of ReadValue operations. However, such initialization is not supported in the current State API implementation. Input values are ignored and the initial values for the ReadValue operations are set to zeros unless otherwise specified by the user via [State API](#openvino-state-api).
|
||||
|
||||
### Steps to apply LowLatency2 Transformation
|
||||
|
||||
1. Get CNNNetwork. Either way is acceptable:
|
||||
|
||||
* [from IR or ONNX model](./Integrate_with_customer_application_new_API.md)
|
||||
* [from nGraph Function](../nGraph_DG/build_function.md)
|
||||
|
||||
2. Change the number of iterations inside TensorIterator/Loop nodes in the network using the [Reshape](ShapeInference.md) feature.
|
||||
|
||||
For example, the *sequence_lengths* dimension of input of the network > 1, it means the TensorIterator layer has number_of_iterations > 1. You can reshape the inputs of the network to set *sequence_dimension* to exactly 1.
|
||||
|
||||
```cpp
|
||||
|
||||
// Network before reshape: Parameter (name: X, shape: [2 (sequence_lengths), 1, 16]) -> TensorIterator (num_iteration = 2, axis = 0) -> ...
|
||||
|
||||
cnnNetwork.reshape({"X" : {1, 1, 16});
|
||||
|
||||
// Network after reshape: Parameter (name: X, shape: [1 (sequence_lengths), 1, 16]) -> TensorIterator (num_iteration = 1, axis = 0) -> ...
|
||||
|
||||
```
|
||||
**Unrolling**: If the LowLatency2 transformation is applied to a network containing TensorIterator/Loop nodes with exactly one iteration inside, these nodes are unrolled; otherwise, the nodes remain as they are. Please see [the picture](#example-of-applying-lowlatency2-transformation) for more details.
|
||||
|
||||
3. Apply LowLatency2 transformation
|
||||
```cpp
|
||||
#include "ie_transformations.hpp"
|
||||
|
||||
...
|
||||
|
||||
InferenceEngine::lowLatency2(cnnNetwork); // 2nd argument 'use_const_initializer = true' by default
|
||||
```
|
||||
**Use_const_initializer argument**
|
||||
|
||||
By default, the LowLatency2 transformation inserts a constant subgraph of the same shape as the previous input node, and with zero values as the initializing value for ReadValue nodes, please see the picture below. We can disable insertion of this subgraph by passing the `false` value for the `use_const_initializer` argument.
|
||||
|
||||
```cpp
|
||||
InferenceEngine::lowLatency2(cnnNetwork, false);
|
||||
```
|
||||
|
||||

|
||||
|
||||
**State naming rule:** a name of a state is a concatenation of names: original TensorIterator operation, Parameter of the body, and additional suffix "variable_" + id (0-base indexing, new indexing for each TensorIterator). You can use these rules to predict what the name of the inserted State will be after the transformation is applied. For example:
|
||||
```cpp
|
||||
// Precondition in ngraph::function.
|
||||
// Created TensorIterator and Parameter in body of TensorIterator with names
|
||||
std::string tensor_iterator_name = "TI_name"
|
||||
std::string body_parameter_name = "param_name"
|
||||
std::string idx = "0"; // it's a first variable in the network
|
||||
|
||||
// The State will be named "TI_name/param_name/variable_0"
|
||||
auto state_name = tensor_iterator_name + "//" + body_parameter_name + "//" + "variable_" + idx;
|
||||
|
||||
InferenceEngine::CNNNetwork cnnNetwork = InferenceEngine::CNNNetwork{function};
|
||||
InferenceEngine::lowLatency2(cnnNetwork);
|
||||
|
||||
InferenceEngine::ExecutableNetwork executableNetwork = core->LoadNetwork(/*cnnNetwork, targetDevice, configuration*/);
|
||||
|
||||
// Try to find the Variable by name
|
||||
auto states = executableNetwork.QueryState();
|
||||
for (auto& state : states) {
|
||||
auto name = state.GetName();
|
||||
if (name == state_name) {
|
||||
// some actions
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
4. Use state API. See sections [OpenVINO state API](#openvino-state-api), [Example of stateful network inference](#example-of-stateful-network-inference).
|
||||
|
||||
### Known Limitations
|
||||
1. Unable to execute [Reshape](ShapeInference.md) to change the number iterations of TensorIterator/Loop layers to apply the transformation correctly due to hardcoded values of shapes somewhere in the network.
|
||||
|
||||
The only way you can change the number iterations of TensorIterator/Loop layer is to use the Reshape feature, but networks can be non-reshapable, the most common reason is that the value of shapes is hardcoded in a constant somewhere in the network.
|
||||
|
||||

|
||||
|
||||
**Current solution:** Trim non-reshapable layers via [ModelOptimizer CLI](../MO_DG/prepare_model/convert_model/Converting_Model_General.md) `--input`, `--output`. For example, the parameter and the problematic constant in the picture above can be trimmed using the following command line option:
|
||||
`--input Reshape_layer_name`. The problematic constant can be also replaced using ngraph, as shown in the example below.
|
||||
|
||||
```cpp
|
||||
// nGraph example. How to replace a Constant with hardcoded values of shapes in the network with another one with the new values.
|
||||
// Assume we know which Constant (const_with_hardcoded_shape) prevents the reshape from being applied.
|
||||
// Then we can find this Constant by name on the network and replace it with a new one with the correct shape.
|
||||
auto func = cnnNetwork.getFunction();
|
||||
// Creating the new Constant with a correct shape.
|
||||
// For the example shown in the picture above, the new values of the Constant should be 1, 1, 10 instead of 1, 49, 10
|
||||
auto new_const = std::make_shared<ngraph::opset6::Constant>( /*type, shape, value_with_correct_shape*/ );
|
||||
for (const auto& node : func->get_ops()) {
|
||||
// Trying to find the problematic Constant by name.
|
||||
if (node->get_friendly_name() == "name_of_non_reshapable_const") {
|
||||
auto const_with_hardcoded_shape = std::dynamic_pointer_cast<ngraph::opset6::Constant>(node);
|
||||
// Replacing the problematic Constant with a new one. Do this for all the problematic Constants in the network, then
|
||||
// you can apply the reshape feature.
|
||||
ngraph::replace_node(const_with_hardcoded_shape, new_const);
|
||||
}
|
||||
}
|
||||
```
|
||||
## [DEPRECATED] LowLatency
|
||||
|
||||
LowLatency transformation changes the structure of the network containing [TensorIterator](../ops/infrastructure/TensorIterator_1.md) and [Loop](../ops/infrastructure/Loop_5.md) by adding the ability to work with the state, inserting the Assign/ReadValue layers as it is shown in the picture below.
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ The following list provides the Kaldi\*-specific parameters.
|
||||
|
||||
```sh
|
||||
Kaldi-specific parameters:
|
||||
--counts COUNTS A file name with full path to the counts file
|
||||
--counts COUNTS A file name with full path to the counts file or empty string to utilize count values from the model file
|
||||
--remove_output_softmax
|
||||
Removes the Softmax that is the output layer
|
||||
--remove_memory Remove the Memory layer and add new inputs and outputs instead
|
||||
@@ -78,6 +78,8 @@ python3 mo.py --input_model wsj_dnn5b_smbr.nnet --counts wsj_dnn5b_smbr.counts -
|
||||
\f$|C|\f$ - number of elements in the counts array;
|
||||
* The normalized counts are subtracted from biases of the last or next to last layer (if last layer is SoftMax).
|
||||
|
||||
> **NOTE:** Model Optimizer will show warning if model contains counts values inside model and `--counts` option is not used.
|
||||
|
||||
* If you want to remove the last SoftMax layer in the topology, launch the Model Optimizer with the
|
||||
`--remove_output_softmax` flag.
|
||||
```sh
|
||||
|
||||
@@ -174,11 +174,24 @@ cd darkflow
|
||||
#### <a name="yolov1-v2-to-tf"></a>Convert DarkNet\* YOLOv1 or YOLOv2 Model to TensorFlow\*
|
||||
|
||||
To convert YOLOv1 or YOLOv2 model to TensorFlow, go to the root directory of the cloned DarkFlow repository and run the following command:<br>
|
||||
For Yolo V1:
|
||||
```sh
|
||||
python3 ./flow --model <path_to_model>/<model_name>.cfg --load <path_to_model>/<model_name>.weights --savepb
|
||||
python3 flow --model yolov1.cfg --load yolov1.weights --savepb
|
||||
```
|
||||
|
||||
If the model was successfully converted, you can find the `<model_name>.meta` and `<model_name>.pb` files
|
||||
For Yolo V2 with VOC dataset `--labels` argument should be specified and additional changes in the original exporting script are required.
|
||||
In the file [https://github.com/thtrieu/darkflow/blob/b187c65/darkflow/utils/loader.py#L121](https://github.com/thtrieu/darkflow/blob/b187c65630f9aa1bb8b809c33ec67c8cc5d60124/darkflow/utils/loader.py#L121)
|
||||
change line 121 from `self.offset = 16` to `self.offset = 20`. Then run:
|
||||
```sh
|
||||
python3 flow --model yolov2-voc.cfg --load yolov2-voc.weights --labels voc-labels.txt --savepb
|
||||
```
|
||||
voc-labels can be found by the following link https://raw.githubusercontent.com/szaza/android-yolo-v2/master/assets/tiny-yolo-voc-labels.txt
|
||||
|
||||
General conversion command is:
|
||||
```sh
|
||||
python3 flow --model <path_to_model>/<model_name>.cfg --load <path_to_model>/<model_name>.weights --labels <path_to_dataset_labels_file> --savepb
|
||||
```
|
||||
Where argument `--labels` for Yolo V1 can be skipped. If the model was successfully converted, you can find the `<model_name>.meta` and `<model_name>.pb` files
|
||||
in `built_graph` subdirectory of the cloned DarkFlow repository.
|
||||
|
||||
File `<model_name>.pb` is a TensorFlow representation of the YOLO model.
|
||||
|
||||
@@ -26,7 +26,7 @@ EXTRACT_LOCAL_CLASSES = NO
|
||||
INPUT = "@DOCS_BUILD_DIR@/docs/IE_PLUGIN_DG" \
|
||||
"@IE_SOURCE_DIR@/src/plugin_api" \
|
||||
"@IE_SOURCE_DIR@/src/transformations/include" \
|
||||
"@OpenVINO_MAIN_SOURCE_DIR@/openvino/itt/include/openvino"
|
||||
"@OpenVINO_SOURCE_DIR@/openvino/itt/include/openvino"
|
||||
|
||||
|
||||
RECURSIVE = YES
|
||||
|
||||
@@ -38,16 +38,16 @@ clamp( x_{i} )=\min\big( \max\left( x_{i}, min\_value \right), max\_value \big)
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: A tensor of type `T` and arbitrary shape. **Required**.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. **Required**.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: A tensor of type `T` with same shape as input tensor.
|
||||
* **1**: A tensor of type *T* with same shape as input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
* *T*: any numeric type.
|
||||
* **Note**: In case of integral numeric type, ceil is used to convert *min* from `float` to `T` and floor is used to convert *max* from `float` to `T`.
|
||||
* **Note**: In case of integral numeric type, ceil is used to convert *min* from `float` to *T* and floor is used to convert *max* from `float` to *T*.
|
||||
|
||||
**Example**
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Elu(x) = \left\{\begin{array}{r}
|
||||
|
||||
where α corresponds to *alpha* attribute.
|
||||
|
||||
*Elu* is equivalent to *ReLU* operation when *alpha* is equal to zero.
|
||||
*Elu* is equivalent to *ReLU* operation when *alpha* is equal to zero.
|
||||
|
||||
**Attributes**
|
||||
|
||||
@@ -34,11 +34,11 @@ where α corresponds to *alpha* attribute.
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: A tensor of type `T` and arbitrary shape. **Required**.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. **Required**.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: The result of element-wise *Elu* function applied to the input tensor. A tensor of type `T` and the same shape as input tensor.
|
||||
* **1**: The result of element-wise *Elu* function applied to the input tensor. A tensor of type *T* and the same shape as input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ exp(x) = e^{x}
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type `T` and arbitrary shape. **Required**.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. **Required**.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise *Exp* function applied to the input tensor. A tensor of type `T` and the same shape as input tensor.
|
||||
* **1**: The result of element-wise *Exp* function applied to the input tensor. A tensor of type *T* and the same shape as input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -45,4 +45,4 @@ exp(x) = e^{x}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -27,11 +27,11 @@ Additionally, *Gelu* function may be approximated as follows:
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: A tensor of type `T` and arbitrary shape. **Required**.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. **Required**.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: The result of element-wise *Gelu* function applied to the input tensor. A tensor of type `T` and the same shape as input tensor.
|
||||
* **1**: The result of element-wise *Gelu* function applied to the input tensor. A tensor of type *T* and the same shape as input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -18,15 +18,15 @@ For each element from the input tensor calculates corresponding
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
* **2**: `alpha` 0D tensor (scalar) of type T. **Required.**
|
||||
* **2**: `alpha` 0D tensor (scalar) of type *T*. **Required.**
|
||||
|
||||
* **3**: `beta` 0D tensor (scalar) of type T. **Required.**
|
||||
* **3**: `beta` 0D tensor (scalar) of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of the hard sigmoid operation. A tensor of type T.
|
||||
* **1**: The result of the hard sigmoid operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -51,4 +51,4 @@ For each element from the input tensor calculates corresponding
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -24,11 +24,11 @@ LogSoftmax(x, axis) = t - Log(ReduceSum(Exp(t), axis))
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: Input tensor *x* of type T with enough number of dimension to be compatible with *axis* attribute. Required.
|
||||
* **1**: Input tensor *x* of type *T* with enough number of dimension to be compatible with *axis* attribute. Required.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: The resulting tensor of the same shape and of type T.
|
||||
* **1**: The resulting tensor of the same shape and of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -59,4 +59,4 @@ where \f$C\f$ is a size of tensor along *axis* dimension.
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -20,11 +20,11 @@ Mish(x) = x\cdot\tanh\big(SoftPlus(x)\big) = x\cdot\tanh\big(\ln(1+e^{x})\big)
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: A tensor of type `T` and arbitrary shape. **Required**.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. **Required**.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: The result of element-wise *Mish* function applied to the input tensor. A tensor of type `T` and the same shape as input tensor.
|
||||
* **1**: The result of element-wise *Mish* function applied to the input tensor. A tensor of type *T* and the same shape as input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -31,15 +31,15 @@ Selu(x) = \lambda\cdot\big(\max(0, x) + \min(0, \alpha(e^{x}-1))\big)
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: `data`. A tensor of type `T` and arbitrary shape. **Required.**
|
||||
* **1**: `data`. A tensor of type *T* and arbitrary shape. **Required.**
|
||||
|
||||
* **2**: `alpha`. 1D tensor with one element of type `T`. **Required.**
|
||||
* **2**: `alpha`. 1D tensor with one element of type *T*. **Required.**
|
||||
|
||||
* **3**: `lambda`. 1D tensor with one element of type `T`. **Required.**
|
||||
* **3**: `lambda`. 1D tensor with one element of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise *Selu* function applied to `data` input tensor. A tensor of type `T` and the same shape as `data` input tensor.
|
||||
* **1**: The result of element-wise *Selu* function applied to `data` input tensor. A tensor of type *T* and the same shape as `data` input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
**Detailed description**
|
||||
|
||||
*SoftPlus* operation is introduced in this [article](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.165.6419).
|
||||
*SoftPlus* operation is introduced in this [article](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.165.6419).
|
||||
|
||||
*SoftPlus* performs element-wise activation function on a given input tensor, based on the following mathematical formula:
|
||||
|
||||
@@ -35,11 +35,11 @@ For example, if *T* is `fp32`, `threshold` should be `20` or if *T* is `fp16`, `
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: A tensor of type `T` and arbitrary shape. **Required**.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. **Required**.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: The result of element-wise *SoftPlus* function applied to the input tensor. A tensor of type `T` and the same shape as input tensor.
|
||||
* **1**: The result of element-wise *SoftPlus* function applied to the input tensor. A tensor of type *T* and the same shape as input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ where β corresponds to `beta` scalar input.
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: `data`. A tensor of type `T` and arbitrary shape. **Required**.
|
||||
* **1**: `data`. A tensor of type *T* and arbitrary shape. **Required**.
|
||||
|
||||
* **2**: `beta`. A non-negative scalar value of type `T`. Multiplication parameter for the sigmoid. Default value 1.0 is used. **Optional**.
|
||||
* **2**: `beta`. A non-negative scalar value of type *T*. Multiplication parameter for the sigmoid. Default value 1.0 is used. **Optional**.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: The result of element-wise *Swish* function applied to the input tensor `data`. A tensor of type `T` and the same shape as `data` input tensor.
|
||||
* **1**: The result of element-wise *Swish* function applied to the input tensor `data`. A tensor of type *T* and the same shape as `data` input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Abs-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Abs* performs element-wise the absolute value with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise abs operation. A tensor of type T.
|
||||
* **1**: The result of element-wise abs operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -48,4 +48,3 @@ a_{i} = abs(a_{i})
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Acos-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Acos* performs element-wise inverse cosine (arccos) operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise acos operation. A tensor of type T.
|
||||
* **1**: The result of element-wise acos operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Acosh-3*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Acosh* performs element-wise hyperbolic inverse cosine (arccosh) operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise acosh operation. A tensor of type T.
|
||||
* **1**: The result of element-wise acosh operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@ o_{i} = a_{i} + b_{i}
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape and rank. **Required.**
|
||||
* **2**: A tensor of type T and arbitrary shape and rank. **Required.**
|
||||
* **1**: A tensor of type *T* and arbitrary shape and rank. **Required.**
|
||||
* **2**: A tensor of type *T* and arbitrary shape and rank. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise addition operation. A tensor of type T with shape equal to broadcasted shape of the two inputs.
|
||||
* **1**: The result of element-wise addition operation. A tensor of type *T* with shape equal to broadcasted shape of the two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Asin-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Asin* performs element-wise inverse sine (arcsin) operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise asin operation. A tensor of type T.
|
||||
* **1**: The result of element-wise asin operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Asinh-3*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Asinh* performs element-wise hyperbolic inverse sine (arcsinh) operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise asinh operation. A tensor of type T.
|
||||
* **1**: The result of element-wise asinh operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Atan-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Atan* performs element-wise inverse tangent (arctangent) operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise atan operation. A tensor of type T.
|
||||
* **1**: The result of element-wise atan operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Atanh-3*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Atanh* performs element-wise hyperbolic inverse tangent (arctangenth) operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise atanh operation. A tensor of type T.
|
||||
* **1**: The result of element-wise atanh operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,35 +2,32 @@
|
||||
|
||||
**Versioned name**: *Cos-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Cos* performs element-wise cosine operation with given tensor.
|
||||
**Short description**: *Cos* performs element-wise cosine operation on a given input tensor.
|
||||
|
||||
**Attributes**:
|
||||
|
||||
No attributes available.
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise cos operation. A tensor of type T.
|
||||
|
||||
**Types**
|
||||
|
||||
* *T*: any numeric type.
|
||||
|
||||
*Cos* does the following with the input tensor *a*:
|
||||
**Detailed description**: *Cos* performs element-wise cosine operation on a given input tensor, based on the following mathematical formula:
|
||||
|
||||
\f[
|
||||
a_{i} = cos(a_{i})
|
||||
\f]
|
||||
|
||||
**Examples**
|
||||
**Attributes**: *Cos* operation has no attributes.
|
||||
|
||||
*Example 1*
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type *T* and arbitrary shape. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise *Cos* operation. A tensor of type *T* and the same shape as the input tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
* *T*: any numeric type.
|
||||
|
||||
|
||||
**Example**
|
||||
|
||||
```xml
|
||||
<layer ... type="Cos">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Cosh-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Cosh* performs element-wise hyperbolic cosine operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise cosh operation. A tensor of type T.
|
||||
* **1**: The result of element-wise cosh operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
**Versioned name**: *CumSum-3*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *CumSum* performs cumulative summation of the input elements along the given axis.
|
||||
|
||||
|
||||
**Detailed description**: By default, it will do the sum inclusively meaning the first element is copied as is. Through an "exclusive" attribute, this behavior can change to exclude the first element. It can also perform summation in the opposite direction of the axis. For that, set reverse attribute to `true`.
|
||||
|
||||
**Attributes**:
|
||||
@@ -32,13 +32,13 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
* **2**: Scalar axis of type T_AXIS. Negative value means counting dimensions from the back. Default value is 0. **Optional.**
|
||||
* **2**: Scalar axis of type *T_AXIS*. Negative value means counting dimensions from the back. Default value is 0. **Optional.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: Output tensor with cumulative sums of the input's elements. A tensor of type T of the same shape as 1st input.
|
||||
* **1**: Output tensor with cumulative sums of the input's elements. A tensor of type *T* of the same shape as 1st input.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@ The result of division by zero is undefined.
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape and rank. **Required.**
|
||||
* **2**: A tensor of type T and arbitrary shape and rank. **Required.**
|
||||
* **1**: A tensor of type *T* and arbitrary shape and rank. **Required.**
|
||||
* **2**: A tensor of type *T* and arbitrary shape and rank. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise division operation. A tensor of type T with shape equal to broadcasted shape of the two inputs.
|
||||
* **1**: The result of element-wise division operation. A tensor of type *T* with shape equal to broadcasted shape of the two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ erf(x) = \pi^{-1} \int_{-x}^{x} e^{-t^2} dt
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise operation. A tensor of type T.
|
||||
* **1**: The result of element-wise operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
**Category**: Arithmetic binary operation
|
||||
|
||||
**Short description**: *FloorMod* performs an element-wise floor modulo operation with two given tensors applying broadcasting rule specified in the *auto_broadcast* attribute.
|
||||
**Short description**: *FloorMod* performs an element-wise floor modulo operation with two given tensors applying broadcasting rule specified in the *auto_broadcast* attribute.
|
||||
|
||||
**Detailed description**
|
||||
As a first step input tensors *a* and *b* are broadcasted if their shapes differ. Broadcasting is performed according to `auto_broadcast` attribute specification. As a second step *FloorMod* operation is computed element-wise on the input tensors *a* and *b* according to the formula below:
|
||||
|
||||
\f[
|
||||
o_{i} = a_{i} % b_{i}
|
||||
\f]
|
||||
\f]
|
||||
|
||||
*FloorMod* operation computes a reminder of a floored division. It is the same behaviour like in Python programming language: `floor(x / y) * y + floor_mod(x, y) = x`. The sign of the result is equal to a sign of a divisor. The result of division by zero is undefined.
|
||||
|
||||
@@ -29,12 +29,12 @@ o_{i} = a_{i} % b_{i}
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape. Required.
|
||||
* **2**: A tensor of type T and arbitrary shape. Required.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. Required.
|
||||
* **2**: A tensor of type *T* and arbitrary shape. Required.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise floor modulo operation. A tensor of type T with shape equal to broadcasted shape of two inputs.
|
||||
* **1**: The result of element-wise floor modulo operation. A tensor of type *T* with shape equal to broadcasted shape of two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Log-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Log* performs element-wise natural logarithm operation with given tensor.
|
||||
|
||||
@@ -18,11 +18,11 @@ a_{i} = log(a_{i})
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T and arbitrary shape. **Required.**
|
||||
* **1**: An tensor of type *T* and arbitrary shape. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise log operation. A tensor of type T and the same shape as input.
|
||||
* **1**: The result of element-wise log operation. A tensor of type *T* and the same shape as input.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -47,4 +47,4 @@ a_{i} = log(a_{i})
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -13,7 +13,7 @@ After broadcasting *Maximum* does the following with the input tensors *a* and *
|
||||
|
||||
\f[
|
||||
o_{i} = max(a_{i}, b_{i})
|
||||
\f]
|
||||
\f]
|
||||
|
||||
**Attributes**:
|
||||
|
||||
@@ -29,12 +29,12 @@ o_{i} = max(a_{i}, b_{i})
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape. Required.
|
||||
* **2**: A tensor of type T and arbitrary shape. Required.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. Required.
|
||||
* **2**: A tensor of type *T* and arbitrary shape. Required.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise maximum operation. A tensor of type T with shape equal to broadcasted shape of two inputs.
|
||||
* **1**: The result of element-wise maximum operation. A tensor of type *T* with shape equal to broadcasted shape of two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -92,4 +92,4 @@ o_{i} = max(a_{i}, b_{i})
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -11,7 +11,7 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ
|
||||
|
||||
\f[
|
||||
o_{i} = min(a_{i}, b_{i})
|
||||
\f]
|
||||
\f]
|
||||
|
||||
**Attributes**:
|
||||
|
||||
@@ -27,12 +27,12 @@ o_{i} = min(a_{i}, b_{i})
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape. Required.
|
||||
* **2**: A tensor of type T and arbitrary shape. Required.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. Required.
|
||||
* **2**: A tensor of type *T* and arbitrary shape. Required.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise minimum operation. A tensor of type T with shape equal to broadcasted shape of two inputs.
|
||||
* **1**: The result of element-wise minimum operation. A tensor of type *T* with shape equal to broadcasted shape of two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -90,4 +90,4 @@ o_{i} = min(a_{i}, b_{i})
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**Category**: Arithmetic binary operation
|
||||
|
||||
**Short description**: *Mod* performs an element-wise modulo operation with two given tensors applying broadcasting rule specified in the *auto_broadcast* attribute.
|
||||
**Short description**: *Mod* performs an element-wise modulo operation with two given tensors applying broadcasting rule specified in the *auto_broadcast* attribute.
|
||||
|
||||
**Detailed description**
|
||||
As a first step input tensors *a* and *b* are broadcasted if their shapes differ. Broadcasting is performed according to `auto_broadcast` attribute specification. As a second step *Mod* operation is computed element-wise on the input tensors *a* and *b* according to the formula below:
|
||||
@@ -30,12 +30,12 @@ o_{i} = a_{i} % b_{i}
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape. Required.
|
||||
* **2**: A tensor of type T and arbitrary shape. Required.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. Required.
|
||||
* **2**: A tensor of type *T* and arbitrary shape. Required.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise modulo operation. A tensor of type T with shape equal to broadcasted shape of two inputs.
|
||||
* **1**: The result of element-wise modulo operation. A tensor of type *T* with shape equal to broadcasted shape of two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -93,4 +93,4 @@ o_{i} = a_{i} % b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -29,12 +29,12 @@ o_{i} = a_{i} * b_{i}
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape and rank. **Required.**
|
||||
* **2**: A tensor of type T and arbitrary shape and rank. **Required.**
|
||||
* **1**: A tensor of type *T* and arbitrary shape and rank. **Required.**
|
||||
* **2**: A tensor of type *T* and arbitrary shape and rank. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise multiplication operation. A tensor of type T with shape equal to broadcasted shape of the two inputs.
|
||||
* **1**: The result of element-wise multiplication operation. A tensor of type *T* with shape equal to broadcasted shape of the two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -93,4 +93,4 @@ o_{i} = a_{i} * b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -11,7 +11,7 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ
|
||||
|
||||
\f[
|
||||
o_{i} = {a_{i} ^ b_{i}}
|
||||
\f]
|
||||
\f]
|
||||
|
||||
**Attributes**:
|
||||
|
||||
@@ -27,12 +27,12 @@ o_{i} = {a_{i} ^ b_{i}}
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape. Required.
|
||||
* **2**: A tensor of type T and arbitrary shape. Required.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. Required.
|
||||
* **2**: A tensor of type *T* and arbitrary shape. Required.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise power operation. A tensor of type T with shape equal to broadcasted shape of two inputs.
|
||||
* **1**: The result of element-wise power operation. A tensor of type *T* with shape equal to broadcasted shape of two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -91,4 +91,4 @@ o_{i} = {a_{i} ^ b_{i}}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Sign-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Sign* performs element-wise sign operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise sign operation. A tensor of type T with mapped elements of the input tensor to -1 (if it is negative), 0 (if it is zero), or 1 (if it is positive).
|
||||
* **1**: The result of element-wise sign operation. A tensor of type *T* with mapped elements of the input tensor to -1 (if it is negative), 0 (if it is zero), or 1 (if it is positive).
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -47,4 +47,4 @@ a_{i} = sign(a_{i})
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Sin-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Sin* performs element-wise sine operation with given tensor.
|
||||
|
||||
@@ -19,11 +19,11 @@ a - value representing angle in radians.
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T and arbitrary rank. **Required.**
|
||||
* **1**: An tensor of type *T* and arbitrary rank. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise sin operation. A tensor of type T.
|
||||
* **1**: The result of element-wise sin operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Sinh-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Sinh* performs element-wise hyperbolic sine (sinh) operation with given tensor.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ
|
||||
|
||||
\f[
|
||||
o_{i} = (a_{i} - b_{i})^2
|
||||
\f]
|
||||
\f]
|
||||
|
||||
**Attributes**:
|
||||
|
||||
@@ -27,12 +27,12 @@ o_{i} = (a_{i} - b_{i})^2
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape. Required.
|
||||
* **2**: A tensor of type T and arbitrary shape. Required.
|
||||
* **1**: A tensor of type *T* and arbitrary shape. Required.
|
||||
* **2**: A tensor of type *T* and arbitrary shape. Required.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise subtract and square the result operation. A tensor of type T with shape equal to broadcasted shape of two inputs.
|
||||
* **1**: The result of element-wise subtract and square the result operation. A tensor of type *T* with shape equal to broadcasted shape of two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -89,4 +89,4 @@ o_{i} = (a_{i} - b_{i})^2
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -29,12 +29,12 @@ o_{i} = a_{i} - b_{i}
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T and arbitrary shape and rank. **Required.**
|
||||
* **2**: A tensor of type T and arbitrary shape and rank. **Required.**
|
||||
* **1**: A tensor of type *T* and arbitrary shape and rank. **Required.**
|
||||
* **2**: A tensor of type *T* and arbitrary shape and rank. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise subtraction operation. A tensor of type T with shape equal to broadcasted shape of the two inputs.
|
||||
* **1**: The result of element-wise subtraction operation. A tensor of type *T* with shape equal to broadcasted shape of the two inputs.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -91,4 +91,4 @@ o_{i} = a_{i} - b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *Tan-1*
|
||||
|
||||
**Category**: Arithmetic unary operation
|
||||
**Category**: Arithmetic unary operation
|
||||
|
||||
**Short description**: *Tan* performs element-wise tangent operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise tan operation. A tensor of type T.
|
||||
* **1**: The result of element-wise tan operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -48,4 +48,3 @@ a_{i} = tan(a_{i})
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **2**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
* **2**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
@@ -40,7 +40,7 @@ After broadcasting *Equal* does the following with the input tensors *a* and *b*
|
||||
o_{i} = a_{i} == b_{i}
|
||||
\f]
|
||||
|
||||
**Examples**
|
||||
**Examples**
|
||||
|
||||
*Example 1*
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **2**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
* **2**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **2**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
* **2**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **2**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
* **2**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
@@ -90,4 +90,4 @@ o_{i} = a_{i} <= b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **2**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
* **2**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
@@ -90,4 +90,4 @@ o_{i} = a_{i} < b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **2**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
* **2**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
@@ -40,7 +40,7 @@ After broadcasting *NotEqual* does the following with the input tensors *a* and
|
||||
o_{i} = a_{i} != b_{i}
|
||||
\f]
|
||||
|
||||
**Examples**
|
||||
**Examples**
|
||||
|
||||
*Example 1*
|
||||
|
||||
@@ -90,4 +90,4 @@ o_{i} = a_{i} != b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -96,12 +96,12 @@ Where
|
||||
* **Default value**: `1`
|
||||
* **Required**: *no*
|
||||
|
||||
* *bilinear_interpolation_padding*
|
||||
* *bilinear_interpolation_pad*
|
||||
|
||||
* **Description**: *bilinear_interpolation_padding* is the number of pixels outside of the feature map boundary to apply bilinear interpolation.
|
||||
* **Range of values**: non-negative integer value
|
||||
* **Type**: `int`
|
||||
* **Default value**: `0`
|
||||
* **Description**: if *bilinear_interpolation_pad* is `true` and the sampling location is within one pixel outside of the feature map boundary, then bilinear interpolation is performed on the zero padded feature map. If *bilinear_interpolation_pad* is `false` and the sampling location is within one pixel outside of the feature map boundary, then the sampling location shifts to the inner boundary of the feature map.
|
||||
* **Range of values**: `False` or `True`
|
||||
* **Type**: `boolean`
|
||||
* **Default value**: `False`
|
||||
* **Required**: *no*
|
||||
|
||||
**Inputs**:
|
||||
@@ -112,7 +112,7 @@ Where
|
||||
|
||||
* **3**: Kernel tensor of type *T* and rank 4. Layout is `OIYX` (number of output channels, number of input channels, spatial axes Y and X). **Required.**
|
||||
|
||||
* **4**: ModulationScalars tensor of type *T2* and rank 4, the values are within [0, 1]. Layout is `NCYX` (number of batches, *deformable_group* \* kernel_Y \* kernel_X, spatial axes Y and X). If the input is not provided, the values are assumed to be equal to 1. **Optional.**
|
||||
* **4**: Mask tensor of type *T* and rank 4. Layout is `NCYX` (number of batches, *deformable_group* \* kernel_Y \* kernel_X, spatial axes Y and X). If the input is not provided, the values are assumed to be equal to 1. **Optional.**
|
||||
|
||||
|
||||
**Outputs**:
|
||||
@@ -122,7 +122,6 @@ Where
|
||||
**Types**:
|
||||
|
||||
* *T*: Any numeric type.
|
||||
* *T2*: Any supported floating point.
|
||||
|
||||
**Example**
|
||||
|
||||
|
||||
+118
-122
@@ -6,143 +6,27 @@
|
||||
|
||||
**Short description**: *PriorBox* operation generates prior boxes of specified sizes and aspect ratios across all dimensions.
|
||||
|
||||
**Attributes**:
|
||||
|
||||
* *min_size (max_size)*
|
||||
|
||||
* **Description**: *min_size (max_size)* is the minimum (maximum) box size (in pixels). For example, *min_size (max_size)* equal 15 means that the minimum (maximum) box size is 15.
|
||||
* **Range of values**: positive floating point numbers
|
||||
* **Type**: float[]
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
* *aspect_ratio*
|
||||
|
||||
* **Description**: *aspect_ratio* is a variance of aspect ratios. Duplicate values are ignored. For example, *aspect_ratio* equal "2.0,3.0" means that for the first box aspect_ratio is equal to 2.0 and for the second box is 3.0.
|
||||
* **Range of values**: set of positive integer numbers
|
||||
* **Type**: float[]
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
* *flip*
|
||||
|
||||
* **Description**: *flip* is a flag that denotes that each *aspect_ratio* is duplicated and flipped. For example, *flip* equals 1 and *aspect_ratio* equals to "4.0,2.0" mean that aspect_ratio is equal to "4.0,2.0,0.25,0.5".
|
||||
* **Range of values**:
|
||||
* false or 0 - each *aspect_ratio* is flipped
|
||||
* true or 1 - each *aspect_ratio* is not flipped
|
||||
* **Type**: boolean
|
||||
* **Default value**: false
|
||||
* **Required**: *no*
|
||||
|
||||
* *clip*
|
||||
|
||||
* **Description**: *clip* is a flag that denotes if each value in the output tensor should be clipped to [0,1] interval.
|
||||
* **Range of values**:
|
||||
* false or 0 - clipping is not performed
|
||||
* true or 1 - each value in the output tensor is clipped to [0,1] interval.
|
||||
* **Type**: boolean
|
||||
* **Default value**: false
|
||||
* **Required**: *no*
|
||||
|
||||
* *step*
|
||||
|
||||
* **Description**: *step* is a distance between box centers. For example, *step* equal 85 means that the distance between neighborhood prior boxes centers is 85.
|
||||
* **Range of values**: floating point non-negative number
|
||||
* **Type**: float
|
||||
* **Default value**: 0
|
||||
* **Required**: *no*
|
||||
|
||||
* *offset*
|
||||
|
||||
* **Description**: *offset* is a shift of box respectively to top left corner. For example, *offset* equal 85 means that the shift of neighborhood prior boxes centers is 85.
|
||||
* **Range of values**: floating point non-negative number
|
||||
* **Type**: float
|
||||
* **Default value**: None
|
||||
* **Required**: *yes*
|
||||
|
||||
* *variance*
|
||||
|
||||
* **Description**: *variance* denotes a variance of adjusting bounding boxes. The attribute could contain 0, 1 or 4 elements.
|
||||
* **Range of values**: floating point positive numbers
|
||||
* **Type**: float[]
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
* *scale_all_sizes*
|
||||
|
||||
* **Description**: *scale_all_sizes* is a flag that denotes type of inference. For example, *scale_all_sizes* equals 0 means that the PriorBox layer is inferred in MXNet-like manner. In particular, *max_size* attribute is ignored.
|
||||
* **Range of values**:
|
||||
* false - *max_size* is ignored
|
||||
* true - *max_size* is used
|
||||
* **Type**: boolean
|
||||
* **Default value**: true
|
||||
* **Required**: *no*
|
||||
|
||||
* *fixed_ratio*
|
||||
|
||||
* **Description**: *fixed_ratio* is an aspect ratio of a box. For example, *fixed_ratio* equal to 2.000000 means that the aspect ratio for the first box aspect ratio is 2.
|
||||
* **Range of values**: a list of positive floating-point numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: None
|
||||
* **Required**: *no*
|
||||
|
||||
* *fixed_size*
|
||||
|
||||
* **Description**: *fixed_size* is an initial box size (in pixels). For example, *fixed_size* equal to 15 means that the initial box size is 15.
|
||||
* **Range of values**: a list of positive floating-point numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: None
|
||||
* **Required**: *no*
|
||||
|
||||
* *density*
|
||||
|
||||
* **Description**: *density* is the square root of the number of boxes of each type. For example, *density* equal to 2 means that the first box generates four boxes of the same size and with the same shifted centers.
|
||||
* **Range of values**: a list of positive floating-point numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: None
|
||||
* **Required**: *no*
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: `output_size` - 1D tensor with two integer elements `[height, width]`. Specifies the spatial size of generated grid with boxes. Required.
|
||||
|
||||
* **2**: `image_size` - 1D tensor with two integer elements `[image_height, image_width]` that specifies shape of the image for which boxes are generated. Required.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: 2D tensor of shape `[2, 4 * height * width * priors_per_point]` with box coordinates. The `priors_per_point` is the number of boxes generated per each grid element. The number depends on layer attribute values.
|
||||
|
||||
**Detailed description**:
|
||||
|
||||
*PriorBox* computes coordinates of prior boxes by following:
|
||||
1. First calculates *center_x* and *center_y* of prior box:
|
||||
\f[
|
||||
W \equiv Width \quad Of \quad Image
|
||||
\f]
|
||||
\f[
|
||||
W \equiv Width \quad Of \quad Image \\
|
||||
H \equiv Height \quad Of \quad Image
|
||||
\f]
|
||||
* If step equals 0:
|
||||
\f[
|
||||
center_x=(w+0.5)
|
||||
\f]
|
||||
\f[
|
||||
center_x=(w+0.5) \\
|
||||
center_y=(h+0.5)
|
||||
\f]
|
||||
* else:
|
||||
\f[
|
||||
center_x=(w+offset)*step
|
||||
\f]
|
||||
\f[
|
||||
center_y=(h+offset)*step
|
||||
\f]
|
||||
\f[
|
||||
w \subset \left( 0, W \right )
|
||||
\f]
|
||||
\f[
|
||||
center_x=(w+offset)*step \\
|
||||
center_y=(h+offset)*step \\
|
||||
w \subset \left( 0, W \right ) \\
|
||||
h \subset \left( 0, H \right )
|
||||
\f]
|
||||
2. Then, for each \f$ s \subset \left( 0, min_sizes \right ) \f$ calculates coordinates of prior boxes:
|
||||
2. Then, for each \f$ s \subset \left( 0, min\_sizes \right ) \f$ calculates coordinates of prior boxes:
|
||||
\f[
|
||||
xmin = \frac{\frac{center_x - s}{2}}{W}
|
||||
\f]
|
||||
@@ -155,6 +39,118 @@
|
||||
\f[
|
||||
ymin = \frac{\frac{center_y + s}{2}}{H}
|
||||
\f]
|
||||
3. If *clip* attribute is set to true, each output value is clipped between \f$ \left< 0, 1 \right> \f$.
|
||||
|
||||
**Attributes**:
|
||||
|
||||
* *min_size (max_size)*
|
||||
|
||||
* **Description**: *min_size (max_size)* is the minimum (maximum) box size (in pixels).
|
||||
* **Range of values**: positive floating point numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
* *aspect_ratio*
|
||||
|
||||
* **Description**: *aspect_ratio* is a variance of aspect ratios. Duplicate values are ignored.
|
||||
* **Range of values**: set of positive integer numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
* *flip*
|
||||
|
||||
* **Description**: *flip* is a flag that denotes that each *aspect_ratio* is duplicated and flipped. For example, *flip* equals 1 and *aspect_ratio* equals to `[4.0,2.0]` mean that aspect_ratio is equal to `[4.0,2.0,0.25,0.5]`.
|
||||
* **Range of values**:
|
||||
* false or 0 - each *aspect_ratio* is flipped
|
||||
* true or 1 - each *aspect_ratio* is not flipped
|
||||
* **Type**: `boolean`
|
||||
* **Default value**: false
|
||||
* **Required**: *no*
|
||||
|
||||
* *clip*
|
||||
|
||||
* **Description**: *clip* is a flag that denotes if each value in the output tensor should be clipped to `[0,1]` interval.
|
||||
* **Range of values**:
|
||||
* false or 0 - clipping is not performed
|
||||
* true or 1 - each value in the output tensor is clipped to `[0,1]` interval.
|
||||
* **Type**: `boolean`
|
||||
* **Default value**: false
|
||||
* **Required**: *no*
|
||||
|
||||
* *step*
|
||||
|
||||
* **Description**: *step* is a distance between box centers.
|
||||
* **Range of values**: floating point non-negative number
|
||||
* **Type**: `float`
|
||||
* **Default value**: 0
|
||||
* **Required**: *no*
|
||||
|
||||
* *offset*
|
||||
|
||||
* **Description**: *offset* is a shift of box respectively to top left corner.
|
||||
* **Range of values**: floating point non-negative number
|
||||
* **Type**: `float`
|
||||
* **Default value**: None
|
||||
* **Required**: *yes*
|
||||
|
||||
* *variance*
|
||||
|
||||
* **Description**: *variance* denotes a variance of adjusting bounding boxes. The attribute could contain 0, 1 or 4 elements.
|
||||
* **Range of values**: floating point positive numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
* *scale_all_sizes*
|
||||
|
||||
* **Description**: *scale_all_sizes* is a flag that denotes type of inference. For example, *scale_all_sizes* equals 0 means that *max_size* attribute is ignored.
|
||||
* **Range of values**:
|
||||
* false - *max_size* is ignored
|
||||
* true - *max_size* is used
|
||||
* **Type**: `boolean`
|
||||
* **Default value**: true
|
||||
* **Required**: *no*
|
||||
|
||||
* *fixed_ratio*
|
||||
|
||||
* **Description**: *fixed_ratio* is an aspect ratio of a box.
|
||||
* **Range of values**: a list of positive floating-point numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
* *fixed_size*
|
||||
|
||||
* **Description**: *fixed_size* is an initial box size (in pixels).
|
||||
* **Range of values**: a list of positive floating-point numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
* *density*
|
||||
|
||||
* **Description**: *density* is the square root of the number of boxes of each type.
|
||||
* **Range of values**: a list of positive floating-point numbers
|
||||
* **Type**: `float[]`
|
||||
* **Default value**: []
|
||||
* **Required**: *no*
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: `output_size` - 1D tensor of type *T_INT* with two elements `[height, width]`. Specifies the spatial size of generated grid with boxes. **Required**.
|
||||
|
||||
* **2**: `image_size` - 1D tensor of type *T_INT* with two elements `[image_height, image_width]` that specifies shape of the image for which boxes are generated. **Required**.
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: 2D tensor of shape `[2, 4 * height * width * priors_per_point]` and type *T_OUT* with box coordinates. The `priors_per_point` is the number of boxes generated per each grid element. The number depends on operation attribute values.
|
||||
|
||||
**Types**
|
||||
|
||||
* *T_INT*: any supported integer type.
|
||||
* *T_OUT*: supported floating point type.
|
||||
|
||||
**Example**
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
**Short description**: *RegionYolo* computes the coordinates of regions with probability for each class.
|
||||
|
||||
**Detailed description**: This operation is directly mapped to the [YOLO9000: Better, Faster, Stronger](https://arxiv.org/pdf/1612.08242.pdf) paper.
|
||||
**Detailed description**: This operation is directly mapped to the [YOLO9000: Better, Faster, Stronger](https://arxiv.org/pdf/1612.08242.pdf) paper.
|
||||
|
||||
**Attributes**:
|
||||
|
||||
@@ -78,13 +78,13 @@
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: `data` - 4D tensor of type `T` and shape `[N, C, H, W]`. **Required.**
|
||||
* **1**: `data` - 4D tensor of type *T* and shape `[N, C, H, W]`. **Required.**
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: tensor of type `T` and rank 4 or less that codes detected regions. Refer to the [YOLO9000: Better, Faster, Stronger](https://arxiv.org/pdf/1612.08242.pdf) paper to decode the output as boxes. `anchors` should be used to decode real box coordinates. If `do_softmax` is set to `0`, then the output shape is `[N, (classes + coords + 1) * len(mask), H, W]`. If `do_softmax` is set to `1`, then output shape is partially flattened and defined in the following way:
|
||||
* **1**: tensor of type *T* and rank 4 or less that codes detected regions. Refer to the [YOLO9000: Better, Faster, Stronger](https://arxiv.org/pdf/1612.08242.pdf) paper to decode the output as boxes. `anchors` should be used to decode real box coordinates. If `do_softmax` is set to `0`, then the output shape is `[N, (classes + coords + 1) * len(mask), H, W]`. If `do_softmax` is set to `1`, then output shape is partially flattened and defined in the following way:
|
||||
|
||||
`flat_dim = data.shape[axis] * data.shape[axis+1] * ... * data.shape[end_axis]`
|
||||
`flat_dim = data.shape[axis] * data.shape[axis+1] * ... * data.shape[end_axis]`
|
||||
`output.shape = [data.shape[0], ..., data.shape[axis-1], flat_dim, data.shape[end_axis + 1], ...]`
|
||||
|
||||
**Types**
|
||||
@@ -133,4 +133,4 @@
|
||||
</output>
|
||||
</layer>
|
||||
|
||||
```
|
||||
```
|
||||
@@ -12,13 +12,13 @@ No attributes available.
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: "start" - A scalar of type T. **Required.**
|
||||
* **2**: "stop" - A scalar of type T. **Required.**
|
||||
* **3**: "step" - A scalar of type T. **Required.**
|
||||
* **1**: "start" - A scalar of type *T*. **Required.**
|
||||
* **2**: "stop" - A scalar of type *T*. **Required.**
|
||||
* **3**: "step" - A scalar of type *T*. **Required.**
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: A tensor of type T.
|
||||
* **1**: A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -87,4 +87,3 @@ val[i]=start+i*step
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: "start" - A scalar of type T1. **Required.**
|
||||
* **2**: "stop" - A scalar of type T2. **Required.**
|
||||
* **3**: "step" - A scalar of type T3. If `step` is equal to zero after casting to `output_type`, behavior is undefined. **Required.**
|
||||
* **1**: "start" - A scalar of type *T1*. **Required.**
|
||||
* **2**: "stop" - A scalar of type *T2*. **Required.**
|
||||
* **3**: "step" - A scalar of type *T3*. If `step` is equal to zero after casting to `output_type`, behavior is undefined. **Required.**
|
||||
|
||||
**Outputs**:
|
||||
|
||||
@@ -124,4 +124,3 @@ This is aligned with PyTorch's operation `torch.arange`, to align with tensorflo
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
|
||||
@@ -89,13 +89,13 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: `data` - tensor of type `T` with data for interpolation. **Required.**
|
||||
* **1**: `data` - tensor of type *T* with data for interpolation. **Required.**
|
||||
|
||||
* **2**: `sizes` - 1D tensor of type `T_SIZE` describing output shape for spatial axes. Number of elements matches the number of indices in `axes` input, the order matches as well. **Required.**
|
||||
* **2**: `sizes` - 1D tensor of type *T_SIZE* describing output shape for spatial axes. Number of elements matches the number of indices in `axes` input, the order matches as well. **Required.**
|
||||
|
||||
* **3**: `scales` - 1D tensor of type `T_SCALES` describing scales for spatial axes. Number and order of elements match the number and order of indices in `axes` input. **Required.**
|
||||
* **3**: `scales` - 1D tensor of type *T_SCALES* describing scales for spatial axes. Number and order of elements match the number and order of indices in `axes` input. **Required.**
|
||||
|
||||
* **4**: `axes` - 1D tensor of type `T_AXES` specifying dimension indices where interpolation is applied, and `axes` is any unordered list of indices of different dimensions of input tensor, e.g. `[0, 4]`, `[4, 0]`, `[4, 2, 1]`, `[1, 2, 3]`. These indices should be non-negative integers from `0` to `rank(data) - 1` inclusively. Other dimensions do not change. The order of elements in `axes` attribute matters, and mapped directly to elements in the 2nd input `sizes`. **Optional** with default value `[0,...,rank(data) - 1]`.
|
||||
* **4**: `axes` - 1D tensor of type *T_AXES* specifying dimension indices where interpolation is applied, and `axes` is any unordered list of indices of different dimensions of input tensor, e.g. `[0, 4]`, `[4, 0]`, `[4, 2, 1]`, `[1, 2, 3]`. These indices should be non-negative integers from `0` to `rank(data) - 1` inclusively. Other dimensions do not change. The order of elements in `axes` attribute matters, and mapped directly to elements in the 2nd input `sizes`. **Optional** with default value `[0,...,rank(data) - 1]`.
|
||||
|
||||
**Outputs**
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
**Short description**: *Result* layer specifies output of the model.
|
||||
|
||||
**Attributes**:
|
||||
**Attributes**:
|
||||
|
||||
No attributes available.
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required.**
|
||||
* **1**: A tensor of type *T*. **Required.**
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -31,4 +31,4 @@
|
||||
</port>
|
||||
</input>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required**.
|
||||
* **2**: A tensor of type T. **Required**.
|
||||
* **1**: A tensor of type *T*. **Required**.
|
||||
* **2**: A tensor of type *T*. **Required**.
|
||||
|
||||
**Outputs**
|
||||
|
||||
@@ -90,4 +90,4 @@ o_{i} = a_{i} and b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Versioned name**: *LogicalNot-1*
|
||||
|
||||
**Category**: Logical unary operation
|
||||
**Category**: Logical unary operation
|
||||
|
||||
**Short description**: *LogicalNot* performs element-wise logical negation operation with given tensor.
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: An tensor of type T. **Required.**
|
||||
* **1**: An tensor of type *T*. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise logical negation operation. A tensor of type T.
|
||||
* **1**: The result of element-wise logical negation operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -47,4 +47,4 @@ a_{i} = not(a_{i})
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required**.
|
||||
* **2**: A tensor of type T. **Required**.
|
||||
* **1**: A tensor of type *T*. **Required**.
|
||||
* **2**: A tensor of type *T*. **Required**.
|
||||
|
||||
**Outputs**
|
||||
|
||||
@@ -90,4 +90,4 @@ o_{i} = a_{i} or b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -20,12 +20,12 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: A tensor of type T. **Required**.
|
||||
* **2**: A tensor of type T. **Required**.
|
||||
* **1**: A tensor of type *T*. **Required**.
|
||||
* **2**: A tensor of type *T*. **Required**.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: The result of element-wise logical XOR operation. A tensor of type T.
|
||||
* **1**: The result of element-wise logical XOR operation. A tensor of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -90,4 +90,4 @@ o_{i} = a_{i} xor b_{i}
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -48,11 +48,11 @@ If `mode = depth_first`:
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: `data` - input tensor of type T with rank >= 3. **Required**.
|
||||
* **1**: `data` - input tensor of type *T* with rank >= 3. **Required**.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: permuted tensor of type T and shape `[N, C / block_size ^ K, D1 * block_size, D2 * block_size, ..., DK * block_size]`.
|
||||
* **1**: permuted tensor of type *T* and shape `[N, C / block_size ^ K, D1 * block_size, D2 * block_size, ..., DK * block_size]`.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ for batch in range(BATCH_SIZE):
|
||||
parent = parent_idx[max_sequence_in_beam - 1, batch, beam]
|
||||
|
||||
final_idx[max_sequence_in_beam - 1, batch, beam] = step_idx[max_sequence_in_beam - 1, batch, beam]
|
||||
|
||||
|
||||
for level in reversed(range(max_sequence_in_beam - 1)):
|
||||
final_idx[level, batch, beam] = step_idx[level, batch, parent]
|
||||
|
||||
parent = parent_idx[level, batch, parent]
|
||||
|
||||
# For a given beam, past the time step containing the first decoded end_token
|
||||
# For a given beam, past the time step containing the first decoded end_token
|
||||
# all values are filled in with end_token.
|
||||
finished = False
|
||||
for time in range(max_sequence_in_beam):
|
||||
@@ -43,18 +43,18 @@ Element data types for all input tensors should match each other.
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: `step_ids` -- a tensor of shape `[MAX_TIME, BATCH_SIZE, BEAM_WIDTH]` of type `T` with indices from per each step. Required.
|
||||
* **1**: `step_ids` -- a tensor of shape `[MAX_TIME, BATCH_SIZE, BEAM_WIDTH]` of type *T* with indices from per each step. Required.
|
||||
|
||||
* **2**: `parent_idx` -- a tensor of shape `[MAX_TIME, BATCH_SIZE, BEAM_WIDTH]` of type `T` with parent beam indices. Required.
|
||||
* **2**: `parent_idx` -- a tensor of shape `[MAX_TIME, BATCH_SIZE, BEAM_WIDTH]` of type *T* with parent beam indices. Required.
|
||||
|
||||
* **3**: `max_seq_len` -- a tensor of shape `[BATCH_SIZE]` of type `T` with maximum lengths for each sequence in the batch. Required.
|
||||
* **3**: `max_seq_len` -- a tensor of shape `[BATCH_SIZE]` of type *T* with maximum lengths for each sequence in the batch. Required.
|
||||
|
||||
* **4**: `end_token` -- a scalar tensor of type `T` with value of the end marker in a sequence. Required.
|
||||
* **4**: `end_token` -- a scalar tensor of type *T* with value of the end marker in a sequence. Required.
|
||||
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: `final_idx` -- a tensor of shape `[MAX_TIME, BATCH_SIZE, BEAM_WIDTH]` of type `T`.
|
||||
* **1**: `final_idx` -- a tensor of shape `[MAX_TIME, BATCH_SIZE, BEAM_WIDTH]` of type *T*.
|
||||
|
||||
**Types**
|
||||
|
||||
|
||||
@@ -6,11 +6,32 @@
|
||||
|
||||
**Short description**: *SpaceToDepth* operation rearranges data from the spatial dimensions of the input tensor into depth dimension of the output tensor.
|
||||
|
||||
|
||||
**Detailed description**
|
||||
|
||||
*SpaceToDepth* operation permutes element from the input tensor with shape `[N, C, D1, D2, ..., DK]`, to the output tensor where values from the input spatial dimensions `D1, D2, ..., DK` are moved to the new depth dimension.
|
||||
|
||||
The operation is equivalent to the following transformation of the input tensor `data` with `K` spatial dimensions of shape `[N, C, D1, D2, ..., DK]` to *Y* output tensor. If `mode = blocks_first`:
|
||||
|
||||
x' = reshape(data, [N, C, D1 / block_size, block_size, D2 / block_size, block_size, ... , DK / block_size, block_size])
|
||||
|
||||
x'' = transpose(x', [0, 3, 5, ..., K + (K + 1), 1, 2, 4, ..., K + K])
|
||||
|
||||
y = reshape(x'', [N, C * (block_size ^ K), D1 / block_size, D2 / block_size, ... , DK / block_size])
|
||||
|
||||
If `mode = depth_first`:
|
||||
|
||||
x' = reshape(data, [N, C, D1 / block_size, block_size, D2 / block_size, block_size, ..., DK / block_size, block_size])
|
||||
|
||||
x'' = transpose(x', [0, 1, 3, 5, ..., K + (K + 1), 2, 4, ..., K + K])
|
||||
|
||||
y = reshape(x'', [N, C * (block_size ^ K), D1 / block_size, D2 / block_size, ..., DK / block_size])
|
||||
|
||||
**Attributes**
|
||||
|
||||
* *block_size*
|
||||
|
||||
* **Description**: *block_size* specifies the size of the value block to be moved. The depth dimension size must be evenly divided by `block_size ^ (len(input.shape) - 2)`.
|
||||
* **Description**: specifies the size of the value block to be moved. The spatial dimensions must be evenly divided by `block_size`.
|
||||
* **Range of values**: a positive integer
|
||||
* **Type**: `int`
|
||||
* **Default value**: 1
|
||||
@@ -28,32 +49,15 @@
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: `data` - input tensor of any type with rank >= 3. Required.
|
||||
* **1**: `data` - input tensor of type *T* with rank >= 3. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: permuted tensor with shape `[N, C * (block_size ^ K), D1 / block_size, D2 / block_size, ..., DK / block_size]`.
|
||||
* **1**: permuted tensor of type *T* and shape `[N, C * (block_size ^ K), D1 / block_size, D2 / block_size, ..., DK / block_size]`.
|
||||
|
||||
**Detailed description**
|
||||
|
||||
*SpaceToDepth* operation permutes element from the input tensor with shape `[N, C, D1, D2, ..., DK]`, to the output tensor where values from the input spatial dimensions `D1, D2, ..., DK` are moved to the new depth dimension. Refer to the [ONNX* specification](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SpaceToDepth) for an example of the 4D input tensor case.
|
||||
|
||||
The operation is equivalent to the following transformation of the input tensor `data` with `K` spatial dimensions of shape `[N, C, D1, D2, ..., DK]` to *Y* output tensor. If `mode = blocks_first`:
|
||||
|
||||
x' = reshape(data, [N, C, D1/block_size, block_size, D2/block_size, block_size, ... , DK/block_size, block_size])
|
||||
|
||||
x'' = transpose(x', [0, 3, 5, ..., K + (K + 1), 1, 2, 4, ..., K + K])
|
||||
|
||||
y = reshape(x'', [N, C * (block_size ^ K), D1 / block_size, D2 / block_size, ... , DK / block_size])
|
||||
|
||||
If `mode = depth_first`:
|
||||
|
||||
x' = reshape(data, [N, C, D1/block_size, block_size, D2/block_size, block_size, ..., DK/block_size, block_size])
|
||||
|
||||
x'' = transpose(x', [0, 1, 3, 5, ..., K + (K + 1), 2, 4, ..., K + K])
|
||||
|
||||
y = reshape(x'', [N, C * (block_size ^ K), D1 / block_size, D2 / block_size, ..., DK / block_size])
|
||||
**Types**
|
||||
|
||||
* *T*: any supported type.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -77,4 +81,4 @@ If `mode = depth_first`:
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -29,13 +29,13 @@ Where D is the rank of input tensor `data`. The axis being split must be evenly
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: `data`. A tensor of type `T` and arbitrary shape. **Required.**
|
||||
* **2**: `axis`. Axis along `data` to split. A scalar of type `T_AXIS` within the range `[-rank(data), rank(data) - 1]`. Negative values address dimensions from the end. **Required.**
|
||||
* **1**: `data`. A tensor of type *T* and arbitrary shape. **Required.**
|
||||
* **2**: `axis`. Axis along `data` to split. A scalar of type *T_AXIS* within the range `[-rank(data), rank(data) - 1]`. Negative values address dimensions from the end. **Required.**
|
||||
* **Note**: The dimension of input tensor `data` shape along `axis` must be evenly divisible by *num_splits* attribute.
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **Multiple outputs**: Tensors of type `T`. The i-th output has the same shape as `data` input tensor except for dimension along `axis` which is `data.shape[axis]/num_splits`.
|
||||
* **Multiple outputs**: Tensors of type *T*. The i-th output has the same shape as `data` input tensor except for dimension along `axis` which is `data.shape[axis]/num_splits`.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -78,4 +78,4 @@ Where D is the rank of input tensor `data`. The axis being split must be evenly
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**Category**: Data movement operation
|
||||
|
||||
**Short description**: *StridedSlice* extracts a strided slice of a tensor.
|
||||
**Short description**: *StridedSlice* extracts a strided slice of a tensor.
|
||||
|
||||
**Attributes**
|
||||
|
||||
@@ -50,22 +50,22 @@
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: `data` - input tensor to be sliced of type `T` and arbitrary shape. **Required.**
|
||||
* **1**: `data` - input tensor to be sliced of type *T* and arbitrary shape. **Required.**
|
||||
|
||||
* **2**: `begin` - 1D tensor of type `T_IND` with begin indexes for input tensor slicing. **Required.**
|
||||
* **2**: `begin` - 1D tensor of type *T_IND* with begin indexes for input tensor slicing. **Required.**
|
||||
Out-of-bounds values are silently clamped. If `begin_mask[i]` is `1`, the value of `begin[i]` is ignored and the range of the appropriate dimension starts from `0`. Negative values mean indexing starts from the end. For example, if `data=[1,2,3]`, `begin[0]=-1` means `begin[0]=3`.
|
||||
|
||||
* **3**: `end` - 1D tensor of type `T_IND` with end indexes for input tensor slicing. **Required.**
|
||||
* **3**: `end` - 1D tensor of type *T_IND* with end indexes for input tensor slicing. **Required.**
|
||||
Out-of-bounds values will be silently clamped. If `end_mask[i]` is `1`, the value of `end[i]` is ignored and the full range of the appropriate dimension is used instead. Negative values mean indexing starts from the end. For example, if `data=[1,2,3]`, `end[0]=-1` means `end[0]=3`.
|
||||
|
||||
* **4**: `stride` - 1D tensor of type `T_IND` with strides. **Optional.**
|
||||
* **4**: `stride` - 1D tensor of type *T_IND* with strides. **Optional.**
|
||||
|
||||
**Types**
|
||||
* *T*: any supported type.
|
||||
* *T_IND*: any supported integer type.
|
||||
|
||||
**Example**
|
||||
Example of `begin_mask` & `end_mask` usage.
|
||||
**Example**
|
||||
Example of `begin_mask` & `end_mask` usage.
|
||||
```xml
|
||||
<layer ... type="StridedSlice" ...>
|
||||
<data begin_mask="0,1,1" ellipsis_mask="0,0,0" end_mask="1,1,0" new_axis_mask="0,0,0" shrink_axis_mask="0,0,0"/>
|
||||
@@ -86,7 +86,7 @@ Example of `begin_mask` & `end_mask` usage.
|
||||
</port>
|
||||
</input>
|
||||
<output>
|
||||
<port id="4">
|
||||
<port id="4">
|
||||
<dim>1</dim>
|
||||
<dim>3</dim>
|
||||
<dim>2</dim>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**Category**: Data movement
|
||||
|
||||
**Short description**: *Tile* operation repeats an input tensor *"data"* the number of times given by *"repeats"* input tensor along each dimension.
|
||||
**Short description**: *Tile* operation repeats an input tensor *"data"* the number of times given by *"repeats"* input tensor along each dimension.
|
||||
* If number of elements in *"repeats"* is more than shape of *"data"*, then *"data"* will be promoted to "*repeats*" by prepending new axes, e.g. let's shape of *"data"* is equal to (2, 3) and *"repeats"* is equal to [2, 2, 2], then shape of *"data"* will be promoted to (1, 2, 3) and result shape will be (2, 4, 6).
|
||||
* If number of elements in *"repeats"* is less than shape of *"data"*, then *"repeats"* will be promoted to "*data*" by prepending 1's to it, e.g. let's shape of *"data"* is equal to (4, 2, 3) and *"repeats"* is equal to [2, 2], then *"repeats"* will be promoted to [1, 2, 2] and result shape will be (4, 4, 6)
|
||||
|
||||
@@ -14,12 +14,12 @@ No attributes available.
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: "data" - an input tensor to be padded. A tensor of type T1. **Required.**
|
||||
* **2**: "repeats" - a per-dimension replication factor. For example, *repeats* equal to 88 means that the output tensor gets 88 copies of data from the specified axis. A tensor of type T2. **Required.**
|
||||
* **1**: "data" - an input tensor to be padded. A tensor of type *T1*. **Required.**
|
||||
* **2**: "repeats" - a per-dimension replication factor. For example, *repeats* equal to 88 means that the output tensor gets 88 copies of data from the specified axis. A tensor of type *T2*. **Required.**
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: The count of dimensions in result shape will be equal to the maximum from count of dimensions in "data" shape and number of elements in "repeats". A tensor with type matching 1st tensor.
|
||||
* **1**: The count of dimensions in result shape will be equal to the maximum from count of dimensions in "data" shape and number of elements in "repeats". A tensor with type matching 1st tensor.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -89,7 +89,7 @@ No attributes available.
|
||||
<layer ... type="Tile">
|
||||
<input>
|
||||
<port id="0">
|
||||
<dim>5</dim>
|
||||
<dim>5</dim>
|
||||
<dim>2</dim>
|
||||
<dim>3</dim>
|
||||
<dim>4</dim>
|
||||
@@ -100,11 +100,11 @@ No attributes available.
|
||||
</input>
|
||||
<output>
|
||||
<port id="2">
|
||||
<dim>5</dim>
|
||||
<dim>5</dim>
|
||||
<dim>2</dim>
|
||||
<dim>6</dim>
|
||||
<dim>12</dim>
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
**Short description**: *Transpose* operation reorders the input tensor dimensions.
|
||||
|
||||
**Detailed description**: *Transpose* operation reorders the input tensor dimensions. Source indexes and destination indexes are bound by the formula:
|
||||
**Detailed description**: *Transpose* operation reorders the input tensor dimensions. Source indexes and destination indexes are bound by the formula:
|
||||
\f[output[i(order[0]), i(order[1]), ..., i(order[N-1])] = input[i(0), i(1), ..., i(N-1)]\\ \quad \textrm{where} \quad i(j) \quad\textrm{is in the range} \quad [0, (input.shape[j]-1)]\f]
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: `arg` - the tensor to be transposed. A tensor of type `T` and arbitrary shape. **Required.**
|
||||
* **2**: `input_order` - the permutation to apply to the axes of the first input shape. A 1D tensor of `n` elements `T_AXIS` type and shape `[n]`, where `n` is the rank of the first input or `0`. The tensor's value must contain every integer in the range `[0, n-1]`, but if an empty tensor is specified (shape `[0]`), then the axes will be inverted. **Required.**
|
||||
* **1**: `arg` - the tensor to be transposed. A tensor of type *T* and arbitrary shape. **Required.**
|
||||
* **2**: `input_order` - the permutation to apply to the axes of the first input shape. A 1D tensor of `n` elements *T_AXIS* type and shape `[n]`, where `n` is the rank of the first input or `0`. The tensor's value must contain every integer in the range `[0, n-1]`, but if an empty tensor is specified (shape `[0]`), then the axes will be inverted. **Required.**
|
||||
|
||||
**Outputs**:
|
||||
|
||||
* **1**: A tensor of type `T` and transposed shape according to the rules specified above.
|
||||
* **1**: A tensor of type *T* and transposed shape according to the rules specified above.
|
||||
|
||||
**Types**
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<dim>0</dim> <!-- input_order is an empty 1D tensor -->
|
||||
</port>
|
||||
</input>
|
||||
<output>
|
||||
<output>
|
||||
<port id="2">
|
||||
<dim>4</dim>
|
||||
<dim>3</dim>
|
||||
@@ -75,4 +75,4 @@
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -63,13 +63,13 @@ output = data / (bias + (alpha / size ** len(axes)) * sqr_sum) ** beta
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: `data` - tensor of type `T` and arbitrary shape. **Required.**
|
||||
* **1**: `data` - tensor of type *T* and arbitrary shape. **Required.**
|
||||
|
||||
* **2**: `axes` - 1D tensor of type `T_IND` which specifies indices of dimensions in `data` which define normalization slices. **Required.**
|
||||
* **2**: `axes` - 1D tensor of type *T_IND* which specifies indices of dimensions in `data` which define normalization slices. **Required.**
|
||||
|
||||
**Outputs**
|
||||
|
||||
* **1**: Output tensor of type `T` and the same shape as the `data` input tensor.
|
||||
* **1**: Output tensor of type *T* and the same shape as the `data` input tensor.
|
||||
|
||||
**Types**
|
||||
* *T*: any supported floating point type.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
**Short description**: Performs max pooling operation on input.
|
||||
|
||||
**Detailed description**: Input shape can be either 3D, 4D or 5D. Max Pooling operation is performed with the respect to input shape from the third dimension to the last dimension. If paddings are used then during the pooling calculation their value are `-inf`. The Max Pooling operation involves sliding a filter over each channel of feature map and downsampling by choosing the biggest value within the region covered by the filter. [Article about max pooling in Convolutional Networks](https://deeplizard.com/learn/video/ZjM_XQa5s6s).
|
||||
**Detailed description**: Input shape can be either 3D, 4D or 5D. Max Pooling operation is performed with the respect to input shape from the third dimension to the last dimension. If paddings are used then during the pooling calculation their value are `-inf`. The Max Pooling operation involves sliding a filter over each channel of feature map and downsampling by choosing the biggest value within the region covered by the filter. [Article about max pooling in Convolutional Networks](https://deeplizard.com/learn/video/ZjM_XQa5s6s).
|
||||
|
||||
**Attributes**: *Pooling* attributes are specified in the `data` node, which is a child of the layer node.
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: 3D, 4D or 5D input tensor of type T. Required.
|
||||
* **1**: 3D, 4D or 5D input tensor of type *T*. Required.
|
||||
|
||||
**Outputs**:
|
||||
* **1**: Input shape can be either `[N, C, H]`, `[N, C, H, W]` or `[N, C, H, W, D]`. Then the corresponding output shape will be `[N, C, H_out]`, `[N, C, H_out, W_out]` or `[N, C, H_out, W_out, D_out]`. Output tensor has the same data type as input tensor.
|
||||
@@ -77,38 +77,38 @@
|
||||
* *T*: floating point or integer type.
|
||||
|
||||
**Mathematical Formulation**
|
||||
Output shape calculation based on `auto_pad` and `rounding_type`:
|
||||
* `auto_pad = explicit` and `rounding_type = floor`
|
||||
`H_out = floor(H + pads_begin[0] + pads_end[0] - kernel[0] / strides[0]) + 1`
|
||||
`W_out = floor(W + pads_begin[1] + pads_end[1] - kernel[1] / strides[1]) + 1`
|
||||
`D_out = floor(D + pads_begin[2] + pads_end[2] - kernel[2] / strides[2]) + 1`
|
||||
|
||||
* `auto_pad = valid` and `rounding_type = floor`
|
||||
`H_out = floor(H - kernel[0] / strides[0]) + 1`
|
||||
`W_out = floor(W - kernel[1] / strides[1]) + 1`
|
||||
`D_out = floor(D - kernel[2] / strides[2]) + 1`
|
||||
|
||||
* `auto_pad = same_upper/same_lower` and `rounding_type = floor`
|
||||
`H_out = H`
|
||||
`W_out = W`
|
||||
`D_out = D`
|
||||
|
||||
* `auto_pad = explicit` and `rounding_type = ceil`
|
||||
`H_out = ceil(H + pads_begin[0] + pads_end[0] - kernel[0] / strides[0]) + 1`
|
||||
`W_out = ceil(W + pads_begin[1] + pads_end[1] - kernel[1] / strides[1]) + 1`
|
||||
`D_out = ceil(D + pads_begin[2] + pads_end[2] - kernel[2] / strides[2]) + 1`
|
||||
|
||||
* `auto_pad = valid` and `rounding_type = ceil`
|
||||
`H_out = ceil(H - kernel[0] / strides[0]) + 1`
|
||||
`W_out = ceil(W - kernel[1] / strides[1]) + 1`
|
||||
`D_out = ceil(D - kernel[2] / strides[2]) + 1`
|
||||
|
||||
* `auto_pad = same_upper/same_lower` and `rounding_type = ceil`
|
||||
`H_out = H`
|
||||
`W_out = W`
|
||||
`D_out = D`
|
||||
Output shape calculation based on `auto_pad` and `rounding_type`:
|
||||
* `auto_pad = explicit` and `rounding_type = floor`
|
||||
`H_out = floor(H + pads_begin[0] + pads_end[0] - kernel[0] / strides[0]) + 1`
|
||||
`W_out = floor(W + pads_begin[1] + pads_end[1] - kernel[1] / strides[1]) + 1`
|
||||
`D_out = floor(D + pads_begin[2] + pads_end[2] - kernel[2] / strides[2]) + 1`
|
||||
|
||||
If `H + pads_begin[i] + pads_end[i] - kernel[i]` is not divided by `strides[i]` evenly then the result is rounded with the respect to `rounding_type` attribute.
|
||||
* `auto_pad = valid` and `rounding_type = floor`
|
||||
`H_out = floor(H - kernel[0] / strides[0]) + 1`
|
||||
`W_out = floor(W - kernel[1] / strides[1]) + 1`
|
||||
`D_out = floor(D - kernel[2] / strides[2]) + 1`
|
||||
|
||||
* `auto_pad = same_upper/same_lower` and `rounding_type = floor`
|
||||
`H_out = H`
|
||||
`W_out = W`
|
||||
`D_out = D`
|
||||
|
||||
* `auto_pad = explicit` and `rounding_type = ceil`
|
||||
`H_out = ceil(H + pads_begin[0] + pads_end[0] - kernel[0] / strides[0]) + 1`
|
||||
`W_out = ceil(W + pads_begin[1] + pads_end[1] - kernel[1] / strides[1]) + 1`
|
||||
`D_out = ceil(D + pads_begin[2] + pads_end[2] - kernel[2] / strides[2]) + 1`
|
||||
|
||||
* `auto_pad = valid` and `rounding_type = ceil`
|
||||
`H_out = ceil(H - kernel[0] / strides[0]) + 1`
|
||||
`W_out = ceil(W - kernel[1] / strides[1]) + 1`
|
||||
`D_out = ceil(D - kernel[2] / strides[2]) + 1`
|
||||
|
||||
* `auto_pad = same_upper/same_lower` and `rounding_type = ceil`
|
||||
`H_out = H`
|
||||
`W_out = W`
|
||||
`D_out = D`
|
||||
|
||||
If `H + pads_begin[i] + pads_end[i] - kernel[i]` is not divided by `strides[i]` evenly then the result is rounded with the respect to `rounding_type` attribute.
|
||||
|
||||
Example 1 shows how *MaxPool* operates with 4D input using 2D kernel and `auto_pad = explicit`
|
||||
|
||||
@@ -194,7 +194,7 @@ output = [[[[5, 3],
|
||||
```xml
|
||||
<layer ... type="MaxPool" ... >
|
||||
<data auto_pad="same_upper" kernel="2,2" pads_begin="1,1" pads_end="1,1" strides="2,2"/>
|
||||
<input>
|
||||
<input>
|
||||
<port id="0">
|
||||
<dim>1</dim>
|
||||
<dim>3</dim>
|
||||
@@ -214,7 +214,7 @@ output = [[[[5, 3],
|
||||
|
||||
<layer ... type="MaxPool" ... >
|
||||
<data auto_pad="explicit" kernel="2,2" pads_begin="1,1" pads_end="1,1" strides="2,2"/>
|
||||
<input>
|
||||
<input>
|
||||
<port id="0">
|
||||
<dim>1</dim>
|
||||
<dim>3</dim>
|
||||
@@ -234,7 +234,7 @@ output = [[[[5, 3],
|
||||
|
||||
<layer ... type="MaxPool" ... >
|
||||
<data auto_pad="valid" kernel="2,2" pads_begin="1,1" pads_end="1,1" strides="2,2"/>
|
||||
<input>
|
||||
<input>
|
||||
<port id="0">
|
||||
<dim>1</dim>
|
||||
<dim>3</dim>
|
||||
@@ -251,4 +251,4 @@ output = [[[[5, 3],
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -30,7 +30,7 @@ The main difference between [CTCGreedyDecoder](CTCGreedyDecoder_1.md) and CTCGre
|
||||
* **Type**: `boolean`
|
||||
* **Default value**: true
|
||||
* **Required**: *No*
|
||||
|
||||
|
||||
* *classes_index_type*
|
||||
|
||||
* **Description**: the type of output tensor with classes indices
|
||||
@@ -38,7 +38,7 @@ The main difference between [CTCGreedyDecoder](CTCGreedyDecoder_1.md) and CTCGre
|
||||
* **Type**: string
|
||||
* **Default value**: "i32"
|
||||
* **Required**: *No*
|
||||
|
||||
|
||||
* *sequence_length_type*
|
||||
|
||||
* **Description**: the type of output tensor with sequence length
|
||||
|
||||
@@ -28,13 +28,13 @@ Sequences in the batch can have different length. The lengths of sequences are c
|
||||
|
||||
**Inputs**
|
||||
|
||||
* **1**: `data` - input tensor with batch of sequences of type `T_F` and shape `[T, N, C]`, where `T` is the maximum sequence length, `N` is the batch size and `C` is the number of classes. **Required.**
|
||||
* **1**: `data` - input tensor with batch of sequences of type *T_F* and shape `[T, N, C]`, where `T` is the maximum sequence length, `N` is the batch size and `C` is the number of classes. **Required.**
|
||||
|
||||
* **2**: `sequence_mask` - input tensor with sequence masks for each sequence in the batch of type `T_F` populated with values `0` and `1` and shape `[T, N]`. **Required.**
|
||||
* **2**: `sequence_mask` - input tensor with sequence masks for each sequence in the batch of type *T_F* populated with values `0` and `1` and shape `[T, N]`. **Required.**
|
||||
|
||||
**Output**
|
||||
|
||||
* **1**: Output tensor of type `T_F` and shape `[N, T, 1, 1]` which is filled with integer elements containing final sequence class indices. A final sequence can be shorter that the size `T` of the tensor, all elements that do not code sequence classes are filled with `-1`.
|
||||
* **1**: Output tensor of type *T_F* and shape `[N, T, 1, 1]` which is filled with integer elements containing final sequence class indices. A final sequence can be shorter that the size `T` of the tensor, all elements that do not code sequence classes are filled with `-1`.
|
||||
|
||||
**Types**
|
||||
* *T_F*: any supported floating point type.
|
||||
@@ -64,4 +64,4 @@ Sequences in the batch can have different length. The lengths of sequences are c
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
```
|
||||
@@ -26,7 +26,7 @@ If `special_zero` is set to `true` index of `0` cannot be larger than the rank o
|
||||
|
||||
**Inputs**:
|
||||
|
||||
* **1**: `data` a tensor of type T and arbitrary shape. **Required**.
|
||||
* **1**: `data` a tensor of type *T* and arbitrary shape. **Required**.
|
||||
|
||||
* **2**: `shape` 1D tensor of type *T_SHAPE* describing output shape. **Required**.
|
||||
|
||||
|
||||
@@ -25,9 +25,8 @@ if(ENABLE_TESTS)
|
||||
add_subdirectory(tests/functional)
|
||||
endif()
|
||||
endif()
|
||||
# [cmake:main]
|
||||
|
||||
# install
|
||||
|
||||
# ATTENTION: uncomment to install component
|
||||
# ie_cpack(template)
|
||||
ie_cpack(template)
|
||||
# [cmake:main]
|
||||
@@ -15,6 +15,7 @@ ie_add_plugin(NAME ${TARGET_NAME}
|
||||
SKIP_INSTALL # ATTENTION: uncomment to install component
|
||||
VERSION_DEFINES_FOR template_plugin.cpp
|
||||
ADD_CLANG_FORMAT)
|
||||
|
||||
# Enable support of CC for the plugin
|
||||
ie_mark_target_as_cc(${TARGET_NAME})
|
||||
|
||||
@@ -30,7 +31,6 @@ target_link_libraries(${TARGET_NAME} PRIVATE
|
||||
|
||||
# Link inference backend library to plugin. Here we use ngraph interpreter_backend as example
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
||||
IE::ngraph_backend
|
||||
IE::interpreter_backend)
|
||||
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
|
||||
|
||||
@@ -15,6 +15,8 @@ endif()
|
||||
add_subdirectory(tools)
|
||||
add_subdirectory(samples)
|
||||
|
||||
openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader ie_samples_utils)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests_deprecated)
|
||||
add_subdirectory(tests)
|
||||
@@ -50,6 +52,11 @@ install(TARGETS format_reader
|
||||
RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL
|
||||
LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
|
||||
if(TARGET benchmark_app)
|
||||
install(TARGETS benchmark_app
|
||||
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# install C samples
|
||||
|
||||
ie_cpack_add_component(c_samples DEPENDS core_c)
|
||||
@@ -85,103 +92,3 @@ if(SPEECH_LIBS_AND_DEMOS)
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT speech_demo_files)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Developer package
|
||||
#
|
||||
|
||||
openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader ie_samples_utils)
|
||||
|
||||
# for Template plugin
|
||||
if(NGRAPH_INTERPRETER_ENABLE)
|
||||
openvino_developer_export_targets(COMPONENT ngraph TARGETS ngraph_backend interpreter_backend)
|
||||
endif()
|
||||
|
||||
function(ie_generate_dev_package_config)
|
||||
# dummy check that OpenCV is here
|
||||
find_package(OpenCV QUIET)
|
||||
|
||||
set(all_dev_targets gflags ie_libraries)
|
||||
foreach(component IN LISTS openvino_export_components)
|
||||
export(TARGETS ${${component}} NAMESPACE IE::
|
||||
APPEND FILE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
|
||||
list(APPEND all_dev_targets ${${component}})
|
||||
endforeach()
|
||||
add_custom_target(ie_dev_targets ALL DEPENDS ${all_dev_targets})
|
||||
|
||||
configure_package_config_file("${OpenVINO_MAIN_SOURCE_DIR}/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig.cmake"
|
||||
INSTALL_DESTINATION share # not used
|
||||
PATH_VARS "OpenVINO_MAIN_SOURCE_DIR;IE_MAIN_SOURCE_DIR;gflags_BINARY_DIR"
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
|
||||
|
||||
configure_file("${OpenVINO_MAIN_SOURCE_DIR}/cmake/templates/InferenceEngineConfig-version.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig-version.cmake"
|
||||
@ONLY)
|
||||
endfunction()
|
||||
|
||||
ie_generate_dev_package_config()
|
||||
|
||||
#
|
||||
# Add extra modules
|
||||
#
|
||||
|
||||
function(register_extra_modules)
|
||||
# post export
|
||||
openvino_developer_export_targets(COMPONENT inference_engine TARGETS inference_engine)
|
||||
openvino_developer_export_targets(COMPONENT ngraph TARGETS ${NGRAPH_LIBRARIES})
|
||||
|
||||
set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/build-modules")
|
||||
|
||||
function(generate_fake_dev_package)
|
||||
set(iedevconfig_file "${InferenceEngineDeveloperPackage_DIR}/InferenceEngineDeveloperPackageConfig.cmake")
|
||||
file(REMOVE "${iedevconfig_file}")
|
||||
|
||||
file(WRITE "${iedevconfig_file}" "\# !! AUTOGENERATED: DON'T EDIT !!\n\n")
|
||||
file(APPEND "${iedevconfig_file}" "ie_deprecated_no_errors()\n")
|
||||
|
||||
foreach(target IN LISTS ${openvino_export_components})
|
||||
if(target)
|
||||
file(APPEND "${iedevconfig_file}" "add_library(IE::${target} ALIAS ${target})\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
generate_fake_dev_package()
|
||||
|
||||
# automatically import plugins from the 'plugins' folder
|
||||
file(GLOB local_extra_modules "plugins/*")
|
||||
if(NGRAPH_INTERPRETER_ENABLE)
|
||||
list(APPEND local_extra_modules "${OpenVINO_MAIN_SOURCE_DIR}/docs/template_plugin")
|
||||
endif()
|
||||
|
||||
# detect where IE_EXTRA_MODULES contains folders with CMakeLists.txt
|
||||
# other folders are supposed to have sub-folders with CMakeLists.txt
|
||||
foreach(module_path IN LISTS IE_EXTRA_MODULES)
|
||||
if(EXISTS "${module_path}/CMakeLists.txt")
|
||||
list(APPEND extra_modules "${module_path}")
|
||||
elseif(module_path)
|
||||
file(GLOB extra_modules ${extra_modules} "${module_path}/*")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# add each extra module
|
||||
foreach(module_path IN LISTS extra_modules local_extra_modules)
|
||||
if(module_path)
|
||||
get_filename_component(module_name "${module_path}" NAME)
|
||||
set(build_module ON)
|
||||
if(NOT EXISTS "${module_path}/CMakeLists.txt") # if module is built not using cmake
|
||||
set(build_module OFF)
|
||||
endif()
|
||||
if(NOT DEFINED BUILD_${module_name})
|
||||
set(BUILD_${module_name} ${build_module} CACHE BOOL "Build ${module_name} extra module" FORCE)
|
||||
endif()
|
||||
if(BUILD_${module_name})
|
||||
message(STATUS "Register ${module_name} to be built in build-modules/${module_name}")
|
||||
add_subdirectory("${module_path}" "build-modules/${module_name}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
register_extra_modules()
|
||||
@@ -105,7 +105,7 @@ function(set_ie_threading_interface_for TARGET_NAME)
|
||||
set(omp_lib_name iomp5)
|
||||
endif ()
|
||||
|
||||
if (NOT IE_MAIN_SOURCE_DIR)
|
||||
if (NOT OpenVINO_SOURCE_DIR)
|
||||
if (WIN32)
|
||||
set(lib_rel_path ${IE_LIB_REL_DIR})
|
||||
set(lib_dbg_path ${IE_LIB_DBG_DIR})
|
||||
|
||||
@@ -83,6 +83,14 @@ foreach(firmware_name IN LISTS VPU_SUPPORTED_FIRMWARES)
|
||||
install(FILES ${${var_name}}
|
||||
DESTINATION ${IE_CPACK_RUNTIME_PATH}
|
||||
COMPONENT myriad)
|
||||
|
||||
if(ENABLE_MYRIAD AND ENABLE_BEH_TESTS)
|
||||
# for MyriadBehaviorTests
|
||||
install(FILES ${${var_name}}
|
||||
DESTINATION tests
|
||||
COMPONENT tests
|
||||
EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_target(vpu_copy_firmware
|
||||
|
||||
@@ -14,7 +14,7 @@ Hello Classification C sample application demonstrates how to use the following
|
||||
|
||||
| Options | Values |
|
||||
|:--- |:---
|
||||
| Validated Models | AlexNet and GoogLeNet (image classification networks)
|
||||
| Validated Models | [alexnet](@ref omz_models_model_alexnet), [googlenet-v1](@ref omz_models_model_googlenet_v1)
|
||||
| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx)
|
||||
| Validated images | The sample uses OpenCV\* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (\*.bmp, \*.png)
|
||||
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
|
||||
|
||||
@@ -12,7 +12,7 @@ Basic Inference Engine API is covered by [Hello Classification C sample](../hell
|
||||
|
||||
| Options | Values |
|
||||
|:--- |:---
|
||||
| Validated Models | AlexNet (image classification network)
|
||||
| Validated Models | [alexnet](@ref omz_models_model_alexnet)
|
||||
| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx)
|
||||
| Validated images | An uncompressed image in the NV12 color format - \*.yuv
|
||||
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
|
||||
|
||||
@@ -20,7 +20,7 @@ Basic Inference Engine API is covered by [Hello Classification C sample](../hell
|
||||
|
||||
| Options | Values |
|
||||
|:--- |:---
|
||||
| Validated Models | Person detection SSD (object detection network)
|
||||
| Validated Models | [person-detection-retail-0013](@ref omz_models_model_person_detection_retail_0013)
|
||||
| Model Format | Inference Engine Intermediate Representation (.xml + .bin), ONNX (.onnx)
|
||||
| Validated images | The sample uses OpenCV* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (.bmp, .png, .jpg)
|
||||
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
|
||||
|
||||
@@ -8,7 +8,7 @@ cmake_minimum_required (VERSION 3.13)
|
||||
# Set the project name
|
||||
project (ie_python_api)
|
||||
|
||||
if(DEFINED IE_MAIN_SOURCE_DIR)
|
||||
if(DEFINED OpenVINO_SOURCE_DIR)
|
||||
set(InferenceEngine_LIBRARIES inference_engine)
|
||||
else()
|
||||
find_package(InferenceEngineDeveloperPackage REQUIRED)
|
||||
|
||||
@@ -14,10 +14,10 @@ Basic Inference Engine API is covered by [Hello Classification Python* Sample](.
|
||||
|
||||
| Options | Values |
|
||||
| :------------------------- | :-------------------------------------------------------------------------------------------------------- |
|
||||
| Validated Models | [alexnet](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/alexnet/alexnet.md) |
|
||||
| Validated Models | [alexnet](@ref omz_models_model_alexnet) |
|
||||
| Model Format | Inference Engine Intermediate Representation (.xml + .bin), ONNX (.onnx) |
|
||||
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
|
||||
| Other language realization | [C++](../../../../samples/classification_sample_async) |
|
||||
| Other language realization | [C++](../../../../samples/classification_sample_async/README.md) |
|
||||
|
||||
## How It Works
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ The following Inference Engine Python API is used in the application:
|
||||
|
||||
| Options | Values |
|
||||
| :------------------------- | :-------------------------------------------------------------------------------------------------------- |
|
||||
| Validated Models | [alexnet](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/alexnet/alexnet.md) |
|
||||
| Validated Models | [alexnet](@ref omz_models_model_alexnet) |
|
||||
| Model Format | Inference Engine Intermediate Representation (.xml + .bin), ONNX (.onnx) |
|
||||
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
|
||||
| Other language realization | [C++](../../../../samples/hello_classification), [C](../../../c/samples/hello_classification) |
|
||||
| Other language realization | [C++](../../../../samples/hello_classification/README.md), [C](../../../c/samples/hello_classification/README.md) |
|
||||
|
||||
## How It Works
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ The following Inference Engine Python API is used in the application:
|
||||
| Options | Values |
|
||||
| :------------------------- | :---------------------------------------------------------------------- |
|
||||
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
|
||||
| Other language realization | [C++](../../../../samples/hello_query_device) |
|
||||
| Other language realization | [C++](../../../../samples/hello_query_device/README.md) |
|
||||
|
||||
## How It Works
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ Basic Inference Engine API is covered by [Hello Classification Python* Sample](.
|
||||
|
||||
| Options | Values |
|
||||
| :------------------------- | :-------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Validated Models | [mobilenet-ssd](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/mobilenet-ssd/mobilenet-ssd.md) |
|
||||
| Validated Models | [mobilenet-ssd](@ref omz_models_model_mobilenet_ssd) |
|
||||
| Model Format | Inference Engine Intermediate Representation (.xml + .bin), ONNX (.onnx) |
|
||||
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
|
||||
| Other language realization | [C++](../../../../samples/hello_reshape_ssd) |
|
||||
| Other language realization | [C++](../../../../samples/hello_reshape_ssd/README.md) |
|
||||
|
||||
## How It Works
|
||||
|
||||
|
||||
Loaded 100 of 358 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user