bigdl-core-npu 2.5.0__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bigdl_core_npu-2.5.0.dist-info/METADATA +35 -0
- bigdl_core_npu-2.5.0.dist-info/RECORD +223 -0
- bigdl_core_npu-2.5.0.dist-info/WHEEL +5 -0
- bigdl_core_npu-2.5.0.dist-info/top_level.txt +1 -0
- intel_npu_acceleration_library/__init__.py +24 -0
- intel_npu_acceleration_library/_version.py +6 -0
- intel_npu_acceleration_library/backend/__init__.py +37 -0
- intel_npu_acceleration_library/backend/base.py +215 -0
- intel_npu_acceleration_library/backend/bindings.py +279 -0
- intel_npu_acceleration_library/backend/compression.py +24 -0
- intel_npu_acceleration_library/backend/convolution.py +58 -0
- intel_npu_acceleration_library/backend/factory.py +944 -0
- intel_npu_acceleration_library/backend/linear.py +60 -0
- intel_npu_acceleration_library/backend/matmul.py +59 -0
- intel_npu_acceleration_library/backend/mlp.py +58 -0
- intel_npu_acceleration_library/backend/ops.py +141 -0
- intel_npu_acceleration_library/backend/qlinear.py +71 -0
- intel_npu_acceleration_library/backend/qmatmul.py +66 -0
- intel_npu_acceleration_library/backend/runtime.py +210 -0
- intel_npu_acceleration_library/backend/sdpa.py +107 -0
- intel_npu_acceleration_library/backend/tensor.py +1050 -0
- intel_npu_acceleration_library/backend/utils.py +70 -0
- intel_npu_acceleration_library/compiler.py +194 -0
- intel_npu_acceleration_library/device.py +230 -0
- intel_npu_acceleration_library/dtypes.py +122 -0
- intel_npu_acceleration_library/external/openvino/__init__.py +71 -0
- intel_npu_acceleration_library/external/openvino/_offline_transformations/__init__.py +20 -0
- intel_npu_acceleration_library/external/openvino/_pyopenvino.cp310-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/_pyopenvino.cp311-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/_pyopenvino.cp312-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/_pyopenvino.cp38-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/_pyopenvino.cp39-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/__init__.py +34 -0
- intel_npu_acceleration_library/external/openvino/frontend/frontend.py +44 -0
- intel_npu_acceleration_library/external/openvino/frontend/onnx/__init__.py +15 -0
- intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp310-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp311-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp312-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp38-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp39-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/paddle/__init__.py +15 -0
- intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp310-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp311-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp312-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp38-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp39-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/__init__.py +19 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/fx_decoder.py +352 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/gptq.py +139 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/module_extension.py +39 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/patch_model.py +98 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp310-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp311-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp312-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp38-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp39-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/backend.py +119 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/backend_utils.py +85 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/compile.py +141 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/decompositions.py +116 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/execute.py +189 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/op_support.py +289 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/partition.py +118 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/ts_decoder.py +536 -0
- intel_npu_acceleration_library/external/openvino/frontend/pytorch/utils.py +256 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/__init__.py +16 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/graph_iterator.py +116 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/node_decoder.py +219 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp310-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp311-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp312-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp38-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp39-win_amd64.pyd +0 -0
- intel_npu_acceleration_library/external/openvino/frontend/tensorflow/utils.py +460 -0
- intel_npu_acceleration_library/external/openvino/helpers/__init__.py +6 -0
- intel_npu_acceleration_library/external/openvino/helpers/packing.py +87 -0
- intel_npu_acceleration_library/external/openvino/preprocess/README.md +60 -0
- intel_npu_acceleration_library/external/openvino/preprocess/__init__.py +26 -0
- intel_npu_acceleration_library/external/openvino/preprocess/torchvision/__init__.py +15 -0
- intel_npu_acceleration_library/external/openvino/preprocess/torchvision/preprocess_converter.py +47 -0
- intel_npu_acceleration_library/external/openvino/preprocess/torchvision/requirements.txt +4 -0
- intel_npu_acceleration_library/external/openvino/preprocess/torchvision/torchvision_preprocessing.py +347 -0
- intel_npu_acceleration_library/external/openvino/properties/__init__.py +21 -0
- intel_npu_acceleration_library/external/openvino/properties/_properties.py +55 -0
- intel_npu_acceleration_library/external/openvino/properties/device/__init__.py +14 -0
- intel_npu_acceleration_library/external/openvino/properties/hint/__init__.py +15 -0
- intel_npu_acceleration_library/external/openvino/properties/intel_auto/__init__.py +12 -0
- intel_npu_acceleration_library/external/openvino/properties/intel_cpu/__init__.py +8 -0
- intel_npu_acceleration_library/external/openvino/properties/intel_gpu/__init__.py +12 -0
- intel_npu_acceleration_library/external/openvino/properties/intel_gpu/hint/__init__.py +11 -0
- intel_npu_acceleration_library/external/openvino/properties/log/__init__.py +11 -0
- intel_npu_acceleration_library/external/openvino/properties/streams/__init__.py +11 -0
- intel_npu_acceleration_library/external/openvino/runtime/__init__.py +85 -0
- intel_npu_acceleration_library/external/openvino/runtime/exceptions.py +17 -0
- intel_npu_acceleration_library/external/openvino/runtime/ie_api.py +631 -0
- intel_npu_acceleration_library/external/openvino/runtime/op/__init__.py +18 -0
- intel_npu_acceleration_library/external/openvino/runtime/op/util/__init__.py +22 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset1/__init__.py +112 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset1/ops.py +3067 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset10/__init__.py +179 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset10/ops.py +173 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset11/__init__.py +179 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset11/ops.py +107 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset12/__init__.py +180 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset12/ops.py +120 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset13/__init__.py +188 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset13/ops.py +399 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset14/__init__.py +190 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset14/ops.py +171 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset15/__init__.py +10 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset15/ops.py +85 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset2/__init__.py +118 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset2/ops.py +216 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset3/__init__.py +134 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset3/ops.py +638 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset4/__init__.py +145 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset4/ops.py +464 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset5/__init__.py +152 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset5/ops.py +372 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset6/__init__.py +154 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset6/ops.py +189 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset7/__init__.py +158 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset7/ops.py +169 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset8/__init__.py +169 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset8/ops.py +783 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset9/__init__.py +175 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset9/ops.py +341 -0
- intel_npu_acceleration_library/external/openvino/runtime/opset_utils.py +22 -0
- intel_npu_acceleration_library/external/openvino/runtime/passes/__init__.py +19 -0
- intel_npu_acceleration_library/external/openvino/runtime/passes/graph_rewrite.py +33 -0
- intel_npu_acceleration_library/external/openvino/runtime/passes/manager.py +26 -0
- intel_npu_acceleration_library/external/openvino/runtime/properties/__init__.py +38 -0
- intel_npu_acceleration_library/external/openvino/runtime/properties/hint/__init__.py +25 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/__init__.py +7 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/broadcasting.py +44 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/data_helpers/__init__.py +8 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/data_helpers/data_dispatcher.py +429 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/data_helpers/wrappers.py +148 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/decorators.py +70 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/input_validation.py +133 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/node_factory.py +127 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/reduction.py +25 -0
- intel_npu_acceleration_library/external/openvino/runtime/utils/types.py +175 -0
- intel_npu_acceleration_library/external/openvino/tools/__init__.py +4 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/__init__.py +3 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/benchmark.py +186 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/main.py +695 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/parameters.py +199 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/__init__.py +3 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/constants.py +26 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/inputs_filling.py +482 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/logging.py +8 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/statistics_report.py +296 -0
- intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/utils.py +836 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/__init__.py +20 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/__main__.py +10 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/cli_parser.py +633 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/convert.py +102 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/convert_data_type.py +82 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/convert_impl.py +536 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/environment_setup_utils.py +50 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/error.py +49 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/get_ov_update_message.py +16 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/help.py +45 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/logger.py +91 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/main.py +35 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/__init__.py +2 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/analysis.py +46 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/check_config.py +57 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/extractor.py +447 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/layout_utils.py +73 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/moc_emit_ir.py +32 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/offline_transformations.py +107 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/paddle_frontend_utils.py +83 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/pipeline.py +246 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/preprocessing.py +220 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/pytorch_frontend_utils.py +205 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/shape_utils.py +109 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/type_utils.py +82 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/ovc.py +13 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/telemetry_params.py +6 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/telemetry_stub.py +28 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/telemetry_utils.py +118 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/utils.py +109 -0
- intel_npu_acceleration_library/external/openvino/tools/ovc/version.py +80 -0
- intel_npu_acceleration_library/external/openvino/torch/__init__.py +5 -0
- intel_npu_acceleration_library/external/openvino/utils.py +98 -0
- intel_npu_acceleration_library/functional/__init__.py +8 -0
- intel_npu_acceleration_library/functional/scaled_dot_product_attention.py +47 -0
- intel_npu_acceleration_library/lib/Release/cache.json +113732 -0
- intel_npu_acceleration_library/lib/Release/intel_npu_acceleration_library.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_auto_batch_plugin.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_auto_plugin.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_c.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_hetero_plugin.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_intel_cpu_plugin.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_intel_gpu_plugin.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_intel_npu_plugin.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_ir_frontend.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_onnx_frontend.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_paddle_frontend.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_pytorch_frontend.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_tensorflow_frontend.dll +0 -0
- intel_npu_acceleration_library/lib/Release/openvino_tensorflow_lite_frontend.dll +0 -0
- intel_npu_acceleration_library/lib/Release/tbb12.dll +0 -0
- intel_npu_acceleration_library/lib/Release/tbb12_debug.dll +0 -0
- intel_npu_acceleration_library/lib/Release/tbbbind_2_5.dll +0 -0
- intel_npu_acceleration_library/lib/Release/tbbbind_2_5_debug.dll +0 -0
- intel_npu_acceleration_library/lib/Release/tbbmalloc.dll +0 -0
- intel_npu_acceleration_library/lib/Release/tbbmalloc_debug.dll +0 -0
- intel_npu_acceleration_library/lib/Release/tbbmalloc_proxy.dll +0 -0
- intel_npu_acceleration_library/lib/Release/tbbmalloc_proxy_debug.dll +0 -0
- intel_npu_acceleration_library/modelling.py +150 -0
- intel_npu_acceleration_library/nn/__init__.py +20 -0
- intel_npu_acceleration_library/nn/autograd.py +68 -0
- intel_npu_acceleration_library/nn/conv.py +257 -0
- intel_npu_acceleration_library/nn/functional.py +1207 -0
- intel_npu_acceleration_library/nn/linear.py +162 -0
- intel_npu_acceleration_library/nn/llm.py +417 -0
- intel_npu_acceleration_library/nn/module.py +393 -0
- intel_npu_acceleration_library/optimizations.py +157 -0
- intel_npu_acceleration_library/quantization.py +174 -0
@@ -0,0 +1,152 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2018-2024 Intel Corporation
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
4
|
+
|
5
|
+
from openvino.runtime.opset1.ops import absolute
|
6
|
+
from openvino.runtime.opset1.ops import absolute as abs
|
7
|
+
from openvino.runtime.opset1.ops import acos
|
8
|
+
from openvino.runtime.opset4.ops import acosh
|
9
|
+
from openvino.runtime.opset1.ops import add
|
10
|
+
from openvino.runtime.opset1.ops import asin
|
11
|
+
from openvino.runtime.opset4.ops import asinh
|
12
|
+
from openvino.runtime.opset3.ops import assign
|
13
|
+
from openvino.runtime.opset1.ops import atan
|
14
|
+
from openvino.runtime.opset4.ops import atanh
|
15
|
+
from openvino.runtime.opset1.ops import avg_pool
|
16
|
+
from openvino.runtime.opset5.ops import batch_norm_inference
|
17
|
+
from openvino.runtime.opset2.ops import batch_to_space
|
18
|
+
from openvino.runtime.opset1.ops import binary_convolution
|
19
|
+
from openvino.runtime.opset3.ops import broadcast
|
20
|
+
from openvino.runtime.opset3.ops import bucketize
|
21
|
+
from openvino.runtime.opset1.ops import ceiling
|
22
|
+
from openvino.runtime.opset1.ops import ceiling as ceil
|
23
|
+
from openvino.runtime.opset1.ops import clamp
|
24
|
+
from openvino.runtime.opset1.ops import concat
|
25
|
+
from openvino.runtime.opset1.ops import constant
|
26
|
+
from openvino.runtime.opset1.ops import convert
|
27
|
+
from openvino.runtime.opset1.ops import convert_like
|
28
|
+
from openvino.runtime.opset1.ops import convolution
|
29
|
+
from openvino.runtime.opset1.ops import convolution_backprop_data
|
30
|
+
from openvino.runtime.opset1.ops import cos
|
31
|
+
from openvino.runtime.opset1.ops import cosh
|
32
|
+
from openvino.runtime.opset1.ops import ctc_greedy_decoder
|
33
|
+
from openvino.runtime.opset4.ops import ctc_loss
|
34
|
+
from openvino.runtime.opset3.ops import cum_sum
|
35
|
+
from openvino.runtime.opset3.ops import cum_sum as cumsum
|
36
|
+
from openvino.runtime.opset1.ops import deformable_convolution
|
37
|
+
from openvino.runtime.opset1.ops import deformable_psroi_pooling
|
38
|
+
from openvino.runtime.opset1.ops import depth_to_space
|
39
|
+
from openvino.runtime.opset1.ops import detection_output
|
40
|
+
from openvino.runtime.opset1.ops import divide
|
41
|
+
from openvino.runtime.opset1.ops import elu
|
42
|
+
from openvino.runtime.opset3.ops import embedding_bag_offsets_sum
|
43
|
+
from openvino.runtime.opset3.ops import embedding_bag_packed_sum
|
44
|
+
from openvino.runtime.opset3.ops import embedding_segments_sum
|
45
|
+
from openvino.runtime.opset3.ops import extract_image_patches
|
46
|
+
from openvino.runtime.opset1.ops import equal
|
47
|
+
from openvino.runtime.opset1.ops import erf
|
48
|
+
from openvino.runtime.opset1.ops import exp
|
49
|
+
from openvino.runtime.opset1.ops import fake_quantize
|
50
|
+
from openvino.runtime.opset1.ops import floor
|
51
|
+
from openvino.runtime.opset1.ops import floor_mod
|
52
|
+
from openvino.runtime.opset1.ops import gather
|
53
|
+
from openvino.runtime.opset5.ops import gather_nd
|
54
|
+
from openvino.runtime.opset1.ops import gather_tree
|
55
|
+
from openvino.runtime.opset2.ops import gelu
|
56
|
+
from openvino.runtime.opset1.ops import greater
|
57
|
+
from openvino.runtime.opset1.ops import greater_equal
|
58
|
+
from openvino.runtime.opset1.ops import grn
|
59
|
+
from openvino.runtime.opset1.ops import group_convolution
|
60
|
+
from openvino.runtime.opset1.ops import group_convolution_backprop_data
|
61
|
+
from openvino.runtime.opset3.ops import gru_cell
|
62
|
+
from openvino.runtime.opset5.ops import gru_sequence
|
63
|
+
from openvino.runtime.opset1.ops import hard_sigmoid
|
64
|
+
from openvino.runtime.opset5.ops import hsigmoid
|
65
|
+
from openvino.runtime.opset4.ops import hswish
|
66
|
+
from openvino.runtime.opset1.ops import interpolate
|
67
|
+
from openvino.runtime.opset1.ops import less
|
68
|
+
from openvino.runtime.opset1.ops import less_equal
|
69
|
+
from openvino.runtime.opset1.ops import log
|
70
|
+
from openvino.runtime.opset1.ops import logical_and
|
71
|
+
from openvino.runtime.opset1.ops import logical_not
|
72
|
+
from openvino.runtime.opset1.ops import logical_or
|
73
|
+
from openvino.runtime.opset1.ops import logical_xor
|
74
|
+
from openvino.runtime.opset5.ops import log_softmax
|
75
|
+
from openvino.runtime.opset5.ops import loop
|
76
|
+
from openvino.runtime.opset1.ops import lrn
|
77
|
+
from openvino.runtime.opset4.ops import lstm_cell
|
78
|
+
from openvino.runtime.opset5.ops import lstm_sequence
|
79
|
+
from openvino.runtime.opset1.ops import matmul
|
80
|
+
from openvino.runtime.opset1.ops import max_pool
|
81
|
+
from openvino.runtime.opset1.ops import maximum
|
82
|
+
from openvino.runtime.opset1.ops import minimum
|
83
|
+
from openvino.runtime.opset4.ops import mish
|
84
|
+
from openvino.runtime.opset1.ops import mod
|
85
|
+
from openvino.runtime.opset1.ops import multiply
|
86
|
+
from openvino.runtime.opset2.ops import mvn
|
87
|
+
from openvino.runtime.opset1.ops import negative
|
88
|
+
from openvino.runtime.opset5.ops import non_max_suppression
|
89
|
+
from openvino.runtime.opset3.ops import non_zero
|
90
|
+
from openvino.runtime.opset1.ops import normalize_l2
|
91
|
+
from openvino.runtime.opset1.ops import not_equal
|
92
|
+
from openvino.runtime.opset1.ops import one_hot
|
93
|
+
from openvino.runtime.opset1.ops import pad
|
94
|
+
from openvino.runtime.opset1.ops import parameter
|
95
|
+
from openvino.runtime.opset1.ops import power
|
96
|
+
from openvino.runtime.opset1.ops import prelu
|
97
|
+
from openvino.runtime.opset1.ops import prior_box
|
98
|
+
from openvino.runtime.opset1.ops import prior_box_clustered
|
99
|
+
from openvino.runtime.opset1.ops import psroi_pooling
|
100
|
+
from openvino.runtime.opset4.ops import proposal
|
101
|
+
from openvino.runtime.opset1.ops import range
|
102
|
+
from openvino.runtime.opset3.ops import read_value
|
103
|
+
from openvino.runtime.opset4.ops import reduce_l1
|
104
|
+
from openvino.runtime.opset4.ops import reduce_l2
|
105
|
+
from openvino.runtime.opset1.ops import reduce_logical_and
|
106
|
+
from openvino.runtime.opset1.ops import reduce_logical_or
|
107
|
+
from openvino.runtime.opset1.ops import reduce_max
|
108
|
+
from openvino.runtime.opset1.ops import reduce_mean
|
109
|
+
from openvino.runtime.opset1.ops import reduce_min
|
110
|
+
from openvino.runtime.opset1.ops import reduce_prod
|
111
|
+
from openvino.runtime.opset1.ops import reduce_sum
|
112
|
+
from openvino.runtime.opset1.ops import region_yolo
|
113
|
+
from openvino.runtime.opset2.ops import reorg_yolo
|
114
|
+
from openvino.runtime.opset1.ops import relu
|
115
|
+
from openvino.runtime.opset1.ops import reshape
|
116
|
+
from openvino.runtime.opset1.ops import result
|
117
|
+
from openvino.runtime.opset1.ops import reverse_sequence
|
118
|
+
from openvino.runtime.opset3.ops import rnn_cell
|
119
|
+
from openvino.runtime.opset5.ops import rnn_sequence
|
120
|
+
from openvino.runtime.opset3.ops import roi_align
|
121
|
+
from openvino.runtime.opset2.ops import roi_pooling
|
122
|
+
from openvino.runtime.opset5.ops import round
|
123
|
+
from openvino.runtime.opset3.ops import scatter_elements_update
|
124
|
+
from openvino.runtime.opset4.ops import scatter_nd_update
|
125
|
+
from openvino.runtime.opset3.ops import scatter_update
|
126
|
+
from openvino.runtime.opset1.ops import select
|
127
|
+
from openvino.runtime.opset1.ops import selu
|
128
|
+
from openvino.runtime.opset3.ops import shape_of
|
129
|
+
from openvino.runtime.opset3.ops import shuffle_channels
|
130
|
+
from openvino.runtime.opset1.ops import sigmoid
|
131
|
+
from openvino.runtime.opset1.ops import sign
|
132
|
+
from openvino.runtime.opset1.ops import sin
|
133
|
+
from openvino.runtime.opset1.ops import sinh
|
134
|
+
from openvino.runtime.opset1.ops import softmax
|
135
|
+
from openvino.runtime.opset4.ops import softplus
|
136
|
+
from openvino.runtime.opset2.ops import space_to_batch
|
137
|
+
from openvino.runtime.opset1.ops import space_to_depth
|
138
|
+
from openvino.runtime.opset1.ops import split
|
139
|
+
from openvino.runtime.opset1.ops import sqrt
|
140
|
+
from openvino.runtime.opset1.ops import squared_difference
|
141
|
+
from openvino.runtime.opset1.ops import squeeze
|
142
|
+
from openvino.runtime.opset1.ops import strided_slice
|
143
|
+
from openvino.runtime.opset1.ops import subtract
|
144
|
+
from openvino.runtime.opset4.ops import swish
|
145
|
+
from openvino.runtime.opset1.ops import tan
|
146
|
+
from openvino.runtime.opset1.ops import tanh
|
147
|
+
from openvino.runtime.opset1.ops import tensor_iterator
|
148
|
+
from openvino.runtime.opset1.ops import tile
|
149
|
+
from openvino.runtime.opset3.ops import topk
|
150
|
+
from openvino.runtime.opset1.ops import transpose
|
151
|
+
from openvino.runtime.opset1.ops import unsqueeze
|
152
|
+
from openvino.runtime.opset1.ops import variadic_split
|
@@ -0,0 +1,372 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2018-2024 Intel Corporation
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
4
|
+
|
5
|
+
"""Factory functions for all openvino ops."""
|
6
|
+
from typing import Callable, Iterable, List, Optional, Set, Union
|
7
|
+
|
8
|
+
import numpy as np
|
9
|
+
from functools import partial
|
10
|
+
|
11
|
+
from openvino.runtime import Node, Shape
|
12
|
+
from openvino.runtime.op import Constant, Parameter, loop
|
13
|
+
from openvino.runtime.opset_utils import _get_node_factory
|
14
|
+
from openvino.runtime.utils.decorators import binary_op, nameable_op, unary_op
|
15
|
+
from openvino.runtime.utils.input_validation import (
|
16
|
+
assert_list_of_ints,
|
17
|
+
check_valid_attributes,
|
18
|
+
is_non_negative_value,
|
19
|
+
is_positive_value,
|
20
|
+
)
|
21
|
+
from openvino.runtime.utils.node_factory import NodeFactory
|
22
|
+
from openvino.runtime.utils.types import (
|
23
|
+
NodeInput,
|
24
|
+
NumericData,
|
25
|
+
NumericType,
|
26
|
+
ScalarData,
|
27
|
+
TensorShape,
|
28
|
+
as_node,
|
29
|
+
as_nodes,
|
30
|
+
get_dtype,
|
31
|
+
get_element_type,
|
32
|
+
get_element_type_str,
|
33
|
+
make_constant_node,
|
34
|
+
)
|
35
|
+
|
36
|
+
_get_node_factory_opset5 = partial(_get_node_factory, "opset5")
|
37
|
+
|
38
|
+
# -------------------------------------------- ops ------------------------------------------------
|
39
|
+
|
40
|
+
|
41
|
+
@nameable_op
|
42
|
+
def batch_norm_inference(
|
43
|
+
data: NodeInput,
|
44
|
+
gamma: NodeInput,
|
45
|
+
beta: NodeInput,
|
46
|
+
mean: NodeInput,
|
47
|
+
variance: NodeInput,
|
48
|
+
epsilon: float,
|
49
|
+
name: Optional[str] = None,
|
50
|
+
) -> Node:
|
51
|
+
"""Perform layer normalizes a input tensor by mean and variance with appling scale and offset.
|
52
|
+
|
53
|
+
:param data: The input tensor with data for normalization.
|
54
|
+
:param gamma: The scalar scaling for normalized value.
|
55
|
+
:param beta: The bias added to the scaled normalized value.
|
56
|
+
:param mean: The value for mean normalization.
|
57
|
+
:param variance: The value for variance normalization.
|
58
|
+
:param epsilon: The number to be added to the variance to avoid division
|
59
|
+
by zero when normalizing a value.
|
60
|
+
:param name: The optional name of the output node.
|
61
|
+
:return: The new node which performs BatchNormInference.
|
62
|
+
"""
|
63
|
+
inputs = as_nodes(data, gamma, beta, mean, variance, name=name)
|
64
|
+
return _get_node_factory_opset5().create("BatchNormInference", inputs, {"epsilon": epsilon})
|
65
|
+
|
66
|
+
|
67
|
+
@nameable_op
|
68
|
+
def gather_nd(
|
69
|
+
data: NodeInput,
|
70
|
+
indices: NodeInput,
|
71
|
+
batch_dims: Optional[int] = 0,
|
72
|
+
name: Optional[str] = None,
|
73
|
+
) -> Node:
|
74
|
+
"""Return a node which performs GatherND.
|
75
|
+
|
76
|
+
:param data: N-D tensor with data for gathering
|
77
|
+
:param indices: K-D tensor of tuples with indices by which data is gathered
|
78
|
+
:param batch_dims: Scalar value of batch dimensions
|
79
|
+
:return: The new node which performs GatherND
|
80
|
+
"""
|
81
|
+
inputs = as_nodes(data, indices, name=name)
|
82
|
+
|
83
|
+
attributes = {
|
84
|
+
"batch_dims": batch_dims,
|
85
|
+
}
|
86
|
+
|
87
|
+
return _get_node_factory_opset5().create("GatherND", inputs, attributes)
|
88
|
+
|
89
|
+
|
90
|
+
@nameable_op
|
91
|
+
def log_softmax(data: NodeInput, axis: int, name: Optional[str] = None) -> Node:
|
92
|
+
"""Apply LogSoftmax operation on each element of input tensor.
|
93
|
+
|
94
|
+
:param data: The tensor providing input data.
|
95
|
+
:param axis: An axis along which LogSoftmax should be calculated
|
96
|
+
:return: The new node with LogSoftmax operation applied on each element.
|
97
|
+
"""
|
98
|
+
return _get_node_factory_opset5().create("LogSoftmax", [as_node(data, name=name)], {"axis": axis})
|
99
|
+
|
100
|
+
|
101
|
+
@nameable_op
|
102
|
+
def non_max_suppression(
|
103
|
+
boxes: NodeInput,
|
104
|
+
scores: NodeInput,
|
105
|
+
max_output_boxes_per_class: Optional[NodeInput] = None,
|
106
|
+
iou_threshold: Optional[NodeInput] = None,
|
107
|
+
score_threshold: Optional[NodeInput] = None,
|
108
|
+
soft_nms_sigma: Optional[NodeInput] = None,
|
109
|
+
box_encoding: str = "corner",
|
110
|
+
sort_result_descending: bool = True,
|
111
|
+
output_type: str = "i64",
|
112
|
+
name: Optional[str] = None,
|
113
|
+
) -> Node:
|
114
|
+
"""Return a node which performs NonMaxSuppression.
|
115
|
+
|
116
|
+
:param boxes: Tensor with box coordinates.
|
117
|
+
:param scores: Tensor with box scores.
|
118
|
+
:param max_output_boxes_per_class: Tensor Specifying maximum number of boxes
|
119
|
+
to be selected per class.
|
120
|
+
:param iou_threshold: Tensor specifying intersection over union threshold
|
121
|
+
:param score_threshold: Tensor specifying minimum score to consider box for the processing.
|
122
|
+
:param soft_nms_sigma: Tensor specifying the sigma parameter for Soft-NMS.
|
123
|
+
:param box_encoding: Format of boxes data encoding.
|
124
|
+
:param sort_result_descending: Flag that specifies whenever it is necessary to sort selected
|
125
|
+
boxes across batches or not.
|
126
|
+
:param output_type: Output element type.
|
127
|
+
:return: The new node which performs NonMaxSuppression
|
128
|
+
"""
|
129
|
+
if max_output_boxes_per_class is None:
|
130
|
+
max_output_boxes_per_class = make_constant_node(0, np.int64)
|
131
|
+
if iou_threshold is None:
|
132
|
+
iou_threshold = make_constant_node(0, np.float32)
|
133
|
+
if score_threshold is None:
|
134
|
+
score_threshold = make_constant_node(0, np.float32)
|
135
|
+
if soft_nms_sigma is None:
|
136
|
+
inputs = as_nodes(
|
137
|
+
boxes,
|
138
|
+
scores,
|
139
|
+
max_output_boxes_per_class,
|
140
|
+
iou_threshold,
|
141
|
+
score_threshold,
|
142
|
+
name=name,
|
143
|
+
)
|
144
|
+
else:
|
145
|
+
inputs = as_nodes(
|
146
|
+
boxes,
|
147
|
+
scores,
|
148
|
+
max_output_boxes_per_class,
|
149
|
+
iou_threshold,
|
150
|
+
score_threshold,
|
151
|
+
soft_nms_sigma,
|
152
|
+
name=name,
|
153
|
+
)
|
154
|
+
|
155
|
+
attributes = {
|
156
|
+
"box_encoding": box_encoding,
|
157
|
+
"sort_result_descending": sort_result_descending,
|
158
|
+
"output_type": output_type,
|
159
|
+
}
|
160
|
+
|
161
|
+
return _get_node_factory_opset5().create("NonMaxSuppression", inputs, attributes)
|
162
|
+
|
163
|
+
|
164
|
+
@nameable_op
|
165
|
+
def round(data: NodeInput, mode: str = "half_to_even", name: Optional[str] = None) -> Node:
|
166
|
+
"""Apply Round operation on each element of input tensor.
|
167
|
+
|
168
|
+
:param data: The tensor providing input data.
|
169
|
+
:param mode: Rule to round halfway cases. If set to 'half_to_even' then halfs round to the nearest even
|
170
|
+
integer or rounding in such a way that the result heads away from zero if `mode` attribute is
|
171
|
+
'half_away_from_zero`.
|
172
|
+
:param name: An optional name of the output node.
|
173
|
+
:return: The new node with Round operation applied on each element.
|
174
|
+
"""
|
175
|
+
return _get_node_factory_opset5().create("Round", as_nodes(data, name=name), {"mode": mode.upper()})
|
176
|
+
|
177
|
+
|
178
|
+
@nameable_op
|
179
|
+
def lstm_sequence(
|
180
|
+
X: NodeInput,
|
181
|
+
initial_hidden_state: NodeInput,
|
182
|
+
initial_cell_state: NodeInput,
|
183
|
+
sequence_lengths: NodeInput,
|
184
|
+
W: NodeInput,
|
185
|
+
R: NodeInput,
|
186
|
+
B: NodeInput,
|
187
|
+
hidden_size: int,
|
188
|
+
direction: str,
|
189
|
+
activations: Optional[List[str]] = None,
|
190
|
+
activations_alpha: Optional[List[float]] = None,
|
191
|
+
activations_beta: Optional[List[float]] = None,
|
192
|
+
clip: float = 0.0,
|
193
|
+
name: Optional[str] = None,
|
194
|
+
) -> Node:
|
195
|
+
"""Return a node which performs LSTMSequence operation.
|
196
|
+
|
197
|
+
:param X: The input tensor. Shape: [batch_size, seq_length, input_size].
|
198
|
+
:param initial_hidden_state: The hidden state tensor.
|
199
|
+
Shape: [batch_size, num_directions, hidden_size].
|
200
|
+
:param initial_cell_state: The cell state tensor.
|
201
|
+
Shape: [batch_size, num_directions, hidden_size].
|
202
|
+
:param sequence_lengths: Specifies real sequence lengths for each batch element.
|
203
|
+
Shape: [batch_size]. Integer type.
|
204
|
+
:param W: Tensor with weights for matrix multiplication operation with input portion of data.
|
205
|
+
Expected format: fico
|
206
|
+
Shape: [num_directions, 4*hidden_size, input_size].
|
207
|
+
:param R: The tensor with weights for matrix multiplication operation with hidden state.
|
208
|
+
Expected format: fico
|
209
|
+
Shape: [num_directions, 4*hidden_size, hidden_size].
|
210
|
+
:param B: The sum of biases (weight and recurrence). Expected format: fico
|
211
|
+
Shape: [num_directions, 4*hidden_size].
|
212
|
+
:param hidden_size: Specifies hidden state size.
|
213
|
+
:param direction: Specifies if the RNN is forward, reverse, or bidirectional.
|
214
|
+
:param activations: The list of three activation functions for gates.
|
215
|
+
:param activations_alpha: The list of alpha parameters for activation functions.
|
216
|
+
:param activations_beta: The list of beta parameters for activation functions.
|
217
|
+
:param clip: Specifies bound values [-C, C] for tensor clipping performed before activations.
|
218
|
+
:param name: An optional name of the output node.
|
219
|
+
|
220
|
+
:return: The new node represents LSTMSequence. Node outputs count: 3.
|
221
|
+
"""
|
222
|
+
if activations is None:
|
223
|
+
activations = ["sigmoid", "tanh", "tanh"]
|
224
|
+
if activations_alpha is None:
|
225
|
+
activations_alpha = []
|
226
|
+
if activations_beta is None:
|
227
|
+
activations_beta = []
|
228
|
+
|
229
|
+
node_inputs = as_nodes(X, initial_hidden_state, initial_cell_state, sequence_lengths, W, R, B, name=name)
|
230
|
+
|
231
|
+
attributes = {
|
232
|
+
"hidden_size": hidden_size,
|
233
|
+
"direction": direction.lower(),
|
234
|
+
"activations": activations,
|
235
|
+
"activations_alpha": activations_alpha,
|
236
|
+
"activations_beta": activations_beta,
|
237
|
+
"clip": clip,
|
238
|
+
}
|
239
|
+
return _get_node_factory_opset5().create("LSTMSequence", node_inputs, attributes)
|
240
|
+
|
241
|
+
|
242
|
+
def hsigmoid(data: NodeInput, name: Optional[str] = None) -> Node:
|
243
|
+
"""Return a node which performs HSigmoid.
|
244
|
+
|
245
|
+
:param data: Tensor with input data floating point type.
|
246
|
+
:return: The new node which performs HSigmoid
|
247
|
+
"""
|
248
|
+
return _get_node_factory_opset5().create("HSigmoid", as_nodes(data, name=name), {})
|
249
|
+
|
250
|
+
|
251
|
+
@nameable_op
|
252
|
+
def gru_sequence(
|
253
|
+
X: NodeInput,
|
254
|
+
initial_hidden_state: NodeInput,
|
255
|
+
sequence_lengths: NodeInput,
|
256
|
+
W: NodeInput,
|
257
|
+
R: NodeInput,
|
258
|
+
B: NodeInput,
|
259
|
+
hidden_size: int,
|
260
|
+
direction: str,
|
261
|
+
activations: Optional[List[str]] = None,
|
262
|
+
activations_alpha: Optional[List[float]] = None,
|
263
|
+
activations_beta: Optional[List[float]] = None,
|
264
|
+
clip: float = 0.0,
|
265
|
+
linear_before_reset: bool = False,
|
266
|
+
name: Optional[str] = None,
|
267
|
+
) -> Node:
|
268
|
+
"""Return a node which performs GRUSequence operation.
|
269
|
+
|
270
|
+
:param inputs: The input tensor. Shape: [batch_size, seq_length, input_size].
|
271
|
+
:param initial_hidden_state: The hidden state tensor.
|
272
|
+
Shape: [batch_size, num_directions, hidden_size].
|
273
|
+
:param sequence_lengths: Specifies real sequence lengths for each batch element.
|
274
|
+
Shape: [batch_size]. Integer type.
|
275
|
+
:param weights_w: Tensor with weights for matrix multiplication operation with input portion of data.
|
276
|
+
Shape: [num_directions, 3*hidden_size, input_size].
|
277
|
+
:param weights_r: The tensor with weights for matrix multiplication operation with hidden state.
|
278
|
+
Shape: [num_directions, 3*hidden_size, hidden_size].
|
279
|
+
:param biases: The sum of biases (weight and recurrence).
|
280
|
+
For linear_before_reset set True the shape is [num_directions, 4*hidden_size].
|
281
|
+
Otherwise the shape is [num_directions, 3*hidden_size].
|
282
|
+
:param hidden_size: Specifies hidden state size.
|
283
|
+
:param direction: Specifies if the RNN is forward, reverse, or bidirectional.
|
284
|
+
:param activations: The list of three activation functions for gates.
|
285
|
+
:param activations_alpha: The list of alpha parameters for activation functions.
|
286
|
+
:param activations_beta: The list of beta parameters for activation functions.
|
287
|
+
:param clip: Specifies bound values [-C, C] for tensor clipping performed before activations.
|
288
|
+
:param linear_before_reset: Flag denotes if the layer behaves according to the modification
|
289
|
+
of GRU described in the formula in the ONNX documentation.
|
290
|
+
:param name: An optional name of the output node.
|
291
|
+
|
292
|
+
:return: The new node represents GRUSequence. Node outputs count: 2.
|
293
|
+
"""
|
294
|
+
if activations is None:
|
295
|
+
activations = ["sigmoid", "tanh"]
|
296
|
+
if activations_alpha is None:
|
297
|
+
activations_alpha = []
|
298
|
+
if activations_beta is None:
|
299
|
+
activations_beta = []
|
300
|
+
|
301
|
+
node_inputs = as_nodes(X, initial_hidden_state, sequence_lengths, W, R, B, name=name)
|
302
|
+
|
303
|
+
attributes = {
|
304
|
+
"hidden_size": hidden_size,
|
305
|
+
"direction": direction.lower(),
|
306
|
+
"activations": activations,
|
307
|
+
"activations_alpha": activations_alpha,
|
308
|
+
"activations_beta": activations_beta,
|
309
|
+
"linear_before_reset": linear_before_reset,
|
310
|
+
"clip": clip,
|
311
|
+
}
|
312
|
+
return _get_node_factory_opset5().create("GRUSequence", node_inputs, attributes)
|
313
|
+
|
314
|
+
|
315
|
+
@nameable_op
|
316
|
+
def rnn_sequence(
|
317
|
+
X: NodeInput,
|
318
|
+
initial_hidden_state: NodeInput,
|
319
|
+
sequence_lengths: NodeInput,
|
320
|
+
W: NodeInput,
|
321
|
+
R: NodeInput,
|
322
|
+
B: NodeInput,
|
323
|
+
hidden_size: int,
|
324
|
+
direction: str,
|
325
|
+
activations: Optional[List[str]] = None,
|
326
|
+
activations_alpha: Optional[List[float]] = None,
|
327
|
+
activations_beta: Optional[List[float]] = None,
|
328
|
+
clip: float = 0.0,
|
329
|
+
name: Optional[str] = None,
|
330
|
+
) -> Node:
|
331
|
+
"""Return a node which performs RNNSequence operation.
|
332
|
+
|
333
|
+
:param X: The input tensor. Shape: [batch_size, seq_length, input_size].
|
334
|
+
:param initial_hidden_state: The hidden state tensor.
|
335
|
+
Shape: [batch_size, num_directions, hidden_size].
|
336
|
+
:param sequence_lengths: Specifies real sequence lengths for each batch element.
|
337
|
+
Shape: [batch_size]. Integer type.
|
338
|
+
:param W: Tensor with weights for matrix multiplication operation with input portion of data.
|
339
|
+
Shape: [num_directions, hidden_size, input_size].
|
340
|
+
:param R: The tensor with weights for matrix multiplication operation with hidden state.
|
341
|
+
Shape: [num_directions, hidden_size, hidden_size].
|
342
|
+
:param B: The sum of biases (weight and recurrence).
|
343
|
+
Shape: [num_directions, hidden_size].
|
344
|
+
:param hidden_size: Specifies hidden state size.
|
345
|
+
:param direction: Specifies if the RNN is forward, reverse, or bidirectional.
|
346
|
+
:param activations: The list of three activation functions for gates.
|
347
|
+
:param activations_alpha: The list of alpha parameters for activation functions.
|
348
|
+
:param activations_beta: The list of beta parameters for activation functions.
|
349
|
+
:param clip: Specifies bound values [-C, C] for tensor clipping performed before activations.
|
350
|
+
:param name: An optional name of the output node.
|
351
|
+
|
352
|
+
:return: The new node represents RNNSequence. Node outputs count: 2.
|
353
|
+
"""
|
354
|
+
if activations is None:
|
355
|
+
activations = ["tanh"]
|
356
|
+
if activations_alpha is None:
|
357
|
+
activations_alpha = []
|
358
|
+
if activations_beta is None:
|
359
|
+
activations_beta = []
|
360
|
+
|
361
|
+
inputs = as_nodes(X, initial_hidden_state, sequence_lengths, W, R, B, name=name)
|
362
|
+
|
363
|
+
attributes = {
|
364
|
+
"hidden_size": hidden_size,
|
365
|
+
"direction": direction.lower(),
|
366
|
+
"activations": activations,
|
367
|
+
"activations_alpha": activations_alpha,
|
368
|
+
"activations_beta": activations_beta,
|
369
|
+
"clip": clip,
|
370
|
+
}
|
371
|
+
|
372
|
+
return _get_node_factory_opset5().create("RNNSequence", inputs, attributes)
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2018-2024 Intel Corporation
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
4
|
+
|
5
|
+
from openvino.runtime.opset1.ops import absolute
|
6
|
+
from openvino.runtime.opset1.ops import absolute as abs
|
7
|
+
from openvino.runtime.opset1.ops import acos
|
8
|
+
from openvino.runtime.opset4.ops import acosh
|
9
|
+
from openvino.runtime.opset1.ops import add
|
10
|
+
from openvino.runtime.opset1.ops import asin
|
11
|
+
from openvino.runtime.opset4.ops import asinh
|
12
|
+
from openvino.runtime.opset6.ops import assign
|
13
|
+
from openvino.runtime.opset1.ops import atan
|
14
|
+
from openvino.runtime.opset4.ops import atanh
|
15
|
+
from openvino.runtime.opset1.ops import avg_pool
|
16
|
+
from openvino.runtime.opset5.ops import batch_norm_inference
|
17
|
+
from openvino.runtime.opset2.ops import batch_to_space
|
18
|
+
from openvino.runtime.opset1.ops import binary_convolution
|
19
|
+
from openvino.runtime.opset3.ops import broadcast
|
20
|
+
from openvino.runtime.opset3.ops import bucketize
|
21
|
+
from openvino.runtime.opset1.ops import ceiling
|
22
|
+
from openvino.runtime.opset1.ops import ceiling as ceil
|
23
|
+
from openvino.runtime.opset1.ops import clamp
|
24
|
+
from openvino.runtime.opset1.ops import concat
|
25
|
+
from openvino.runtime.opset1.ops import constant
|
26
|
+
from openvino.runtime.opset1.ops import convert
|
27
|
+
from openvino.runtime.opset1.ops import convert_like
|
28
|
+
from openvino.runtime.opset1.ops import convolution
|
29
|
+
from openvino.runtime.opset1.ops import convolution_backprop_data
|
30
|
+
from openvino.runtime.opset1.ops import cos
|
31
|
+
from openvino.runtime.opset1.ops import cosh
|
32
|
+
from openvino.runtime.opset1.ops import ctc_greedy_decoder
|
33
|
+
from openvino.runtime.opset6.ops import ctc_greedy_decoder_seq_len
|
34
|
+
from openvino.runtime.opset4.ops import ctc_loss
|
35
|
+
from openvino.runtime.opset3.ops import cum_sum
|
36
|
+
from openvino.runtime.opset3.ops import cum_sum as cumsum
|
37
|
+
from openvino.runtime.opset1.ops import deformable_convolution
|
38
|
+
from openvino.runtime.opset1.ops import deformable_psroi_pooling
|
39
|
+
from openvino.runtime.opset1.ops import depth_to_space
|
40
|
+
from openvino.runtime.opset1.ops import detection_output
|
41
|
+
from openvino.runtime.opset1.ops import divide
|
42
|
+
from openvino.runtime.opset1.ops import elu
|
43
|
+
from openvino.runtime.opset3.ops import embedding_bag_offsets_sum
|
44
|
+
from openvino.runtime.opset3.ops import embedding_bag_packed_sum
|
45
|
+
from openvino.runtime.opset3.ops import embedding_segments_sum
|
46
|
+
from openvino.runtime.opset3.ops import extract_image_patches
|
47
|
+
from openvino.runtime.opset1.ops import equal
|
48
|
+
from openvino.runtime.opset1.ops import erf
|
49
|
+
from openvino.runtime.opset1.ops import exp
|
50
|
+
from openvino.runtime.opset1.ops import fake_quantize
|
51
|
+
from openvino.runtime.opset1.ops import floor
|
52
|
+
from openvino.runtime.opset1.ops import floor_mod
|
53
|
+
from openvino.runtime.opset1.ops import gather
|
54
|
+
from openvino.runtime.opset6.ops import gather_elements
|
55
|
+
from openvino.runtime.opset5.ops import gather_nd
|
56
|
+
from openvino.runtime.opset1.ops import gather_tree
|
57
|
+
from openvino.runtime.opset2.ops import gelu
|
58
|
+
from openvino.runtime.opset1.ops import greater
|
59
|
+
from openvino.runtime.opset1.ops import greater_equal
|
60
|
+
from openvino.runtime.opset1.ops import grn
|
61
|
+
from openvino.runtime.opset1.ops import group_convolution
|
62
|
+
from openvino.runtime.opset1.ops import group_convolution_backprop_data
|
63
|
+
from openvino.runtime.opset3.ops import gru_cell
|
64
|
+
from openvino.runtime.opset5.ops import gru_sequence
|
65
|
+
from openvino.runtime.opset1.ops import hard_sigmoid
|
66
|
+
from openvino.runtime.opset5.ops import hsigmoid
|
67
|
+
from openvino.runtime.opset4.ops import hswish
|
68
|
+
from openvino.runtime.opset1.ops import interpolate
|
69
|
+
from openvino.runtime.opset1.ops import less
|
70
|
+
from openvino.runtime.opset1.ops import less_equal
|
71
|
+
from openvino.runtime.opset1.ops import log
|
72
|
+
from openvino.runtime.opset1.ops import logical_and
|
73
|
+
from openvino.runtime.opset1.ops import logical_not
|
74
|
+
from openvino.runtime.opset1.ops import logical_or
|
75
|
+
from openvino.runtime.opset1.ops import logical_xor
|
76
|
+
from openvino.runtime.opset5.ops import log_softmax
|
77
|
+
from openvino.runtime.opset5.ops import loop
|
78
|
+
from openvino.runtime.opset1.ops import lrn
|
79
|
+
from openvino.runtime.opset4.ops import lstm_cell
|
80
|
+
from openvino.runtime.opset5.ops import lstm_sequence
|
81
|
+
from openvino.runtime.opset1.ops import matmul
|
82
|
+
from openvino.runtime.opset1.ops import max_pool
|
83
|
+
from openvino.runtime.opset1.ops import maximum
|
84
|
+
from openvino.runtime.opset1.ops import minimum
|
85
|
+
from openvino.runtime.opset4.ops import mish
|
86
|
+
from openvino.runtime.opset1.ops import mod
|
87
|
+
from openvino.runtime.opset1.ops import multiply
|
88
|
+
from openvino.runtime.opset6.ops import mvn
|
89
|
+
from openvino.runtime.opset1.ops import negative
|
90
|
+
from openvino.runtime.opset5.ops import non_max_suppression
|
91
|
+
from openvino.runtime.opset3.ops import non_zero
|
92
|
+
from openvino.runtime.opset1.ops import normalize_l2
|
93
|
+
from openvino.runtime.opset1.ops import not_equal
|
94
|
+
from openvino.runtime.opset1.ops import one_hot
|
95
|
+
from openvino.runtime.opset1.ops import pad
|
96
|
+
from openvino.runtime.opset1.ops import parameter
|
97
|
+
from openvino.runtime.opset1.ops import power
|
98
|
+
from openvino.runtime.opset1.ops import prelu
|
99
|
+
from openvino.runtime.opset1.ops import prior_box
|
100
|
+
from openvino.runtime.opset1.ops import prior_box_clustered
|
101
|
+
from openvino.runtime.opset1.ops import psroi_pooling
|
102
|
+
from openvino.runtime.opset4.ops import proposal
|
103
|
+
from openvino.runtime.opset1.ops import range
|
104
|
+
from openvino.runtime.opset6.ops import read_value
|
105
|
+
from openvino.runtime.opset4.ops import reduce_l1
|
106
|
+
from openvino.runtime.opset4.ops import reduce_l2
|
107
|
+
from openvino.runtime.opset1.ops import reduce_logical_and
|
108
|
+
from openvino.runtime.opset1.ops import reduce_logical_or
|
109
|
+
from openvino.runtime.opset1.ops import reduce_max
|
110
|
+
from openvino.runtime.opset1.ops import reduce_mean
|
111
|
+
from openvino.runtime.opset1.ops import reduce_min
|
112
|
+
from openvino.runtime.opset1.ops import reduce_prod
|
113
|
+
from openvino.runtime.opset1.ops import reduce_sum
|
114
|
+
from openvino.runtime.opset1.ops import region_yolo
|
115
|
+
from openvino.runtime.opset2.ops import reorg_yolo
|
116
|
+
from openvino.runtime.opset1.ops import relu
|
117
|
+
from openvino.runtime.opset1.ops import reshape
|
118
|
+
from openvino.runtime.opset1.ops import result
|
119
|
+
from openvino.runtime.opset1.ops import reverse_sequence
|
120
|
+
from openvino.runtime.opset3.ops import rnn_cell
|
121
|
+
from openvino.runtime.opset5.ops import rnn_sequence
|
122
|
+
from openvino.runtime.opset3.ops import roi_align
|
123
|
+
from openvino.runtime.opset2.ops import roi_pooling
|
124
|
+
from openvino.runtime.opset5.ops import round
|
125
|
+
from openvino.runtime.opset3.ops import scatter_elements_update
|
126
|
+
from openvino.runtime.opset4.ops import scatter_nd_update
|
127
|
+
from openvino.runtime.opset3.ops import scatter_update
|
128
|
+
from openvino.runtime.opset1.ops import select
|
129
|
+
from openvino.runtime.opset1.ops import selu
|
130
|
+
from openvino.runtime.opset3.ops import shape_of
|
131
|
+
from openvino.runtime.opset3.ops import shuffle_channels
|
132
|
+
from openvino.runtime.opset1.ops import sigmoid
|
133
|
+
from openvino.runtime.opset1.ops import sign
|
134
|
+
from openvino.runtime.opset1.ops import sin
|
135
|
+
from openvino.runtime.opset1.ops import sinh
|
136
|
+
from openvino.runtime.opset1.ops import softmax
|
137
|
+
from openvino.runtime.opset4.ops import softplus
|
138
|
+
from openvino.runtime.opset2.ops import space_to_batch
|
139
|
+
from openvino.runtime.opset1.ops import space_to_depth
|
140
|
+
from openvino.runtime.opset1.ops import split
|
141
|
+
from openvino.runtime.opset1.ops import sqrt
|
142
|
+
from openvino.runtime.opset1.ops import squared_difference
|
143
|
+
from openvino.runtime.opset1.ops import squeeze
|
144
|
+
from openvino.runtime.opset1.ops import strided_slice
|
145
|
+
from openvino.runtime.opset1.ops import subtract
|
146
|
+
from openvino.runtime.opset4.ops import swish
|
147
|
+
from openvino.runtime.opset1.ops import tan
|
148
|
+
from openvino.runtime.opset1.ops import tanh
|
149
|
+
from openvino.runtime.opset1.ops import tensor_iterator
|
150
|
+
from openvino.runtime.opset1.ops import tile
|
151
|
+
from openvino.runtime.opset3.ops import topk
|
152
|
+
from openvino.runtime.opset1.ops import transpose
|
153
|
+
from openvino.runtime.opset1.ops import unsqueeze
|
154
|
+
from openvino.runtime.opset1.ops import variadic_split
|