bigdl-core-npu 2.6.0b20250114__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.
Files changed (234) hide show
  1. bigdl-core-npu/__init__.py +0 -0
  2. bigdl-core-npu/include/common.h +96 -0
  3. bigdl-core-npu/include/npu_llm.h +74 -0
  4. bigdl-core-npu/npu_llm.dll +0 -0
  5. bigdl-core-npu/npu_llm.lib +0 -0
  6. bigdl_core_npu-2.6.0b20250114.dist-info/METADATA +44 -0
  7. bigdl_core_npu-2.6.0b20250114.dist-info/RECORD +234 -0
  8. bigdl_core_npu-2.6.0b20250114.dist-info/WHEEL +5 -0
  9. bigdl_core_npu-2.6.0b20250114.dist-info/top_level.txt +2 -0
  10. intel_npu_acceleration_library/__init__.py +24 -0
  11. intel_npu_acceleration_library/_version.py +6 -0
  12. intel_npu_acceleration_library/backend/__init__.py +37 -0
  13. intel_npu_acceleration_library/backend/base.py +250 -0
  14. intel_npu_acceleration_library/backend/bindings.py +383 -0
  15. intel_npu_acceleration_library/backend/compression.py +24 -0
  16. intel_npu_acceleration_library/backend/convolution.py +58 -0
  17. intel_npu_acceleration_library/backend/factory.py +1161 -0
  18. intel_npu_acceleration_library/backend/linear.py +60 -0
  19. intel_npu_acceleration_library/backend/matmul.py +59 -0
  20. intel_npu_acceleration_library/backend/mlp.py +58 -0
  21. intel_npu_acceleration_library/backend/ops.py +142 -0
  22. intel_npu_acceleration_library/backend/qlinear.py +75 -0
  23. intel_npu_acceleration_library/backend/qmatmul.py +66 -0
  24. intel_npu_acceleration_library/backend/runtime.py +215 -0
  25. intel_npu_acceleration_library/backend/sdpa.py +107 -0
  26. intel_npu_acceleration_library/backend/tensor.py +1120 -0
  27. intel_npu_acceleration_library/backend/utils.py +70 -0
  28. intel_npu_acceleration_library/compiler.py +194 -0
  29. intel_npu_acceleration_library/device.py +230 -0
  30. intel_npu_acceleration_library/dtypes.py +155 -0
  31. intel_npu_acceleration_library/external/openvino/__init__.py +72 -0
  32. intel_npu_acceleration_library/external/openvino/_offline_transformations/__init__.py +21 -0
  33. intel_npu_acceleration_library/external/openvino/_pyopenvino.cp310-win_amd64.pyd +0 -0
  34. intel_npu_acceleration_library/external/openvino/_pyopenvino.cp311-win_amd64.pyd +0 -0
  35. intel_npu_acceleration_library/external/openvino/_pyopenvino.cp312-win_amd64.pyd +0 -0
  36. intel_npu_acceleration_library/external/openvino/_pyopenvino.cp38-win_amd64.pyd +0 -0
  37. intel_npu_acceleration_library/external/openvino/_pyopenvino.cp39-win_amd64.pyd +0 -0
  38. intel_npu_acceleration_library/external/openvino/experimental/__init__.py +14 -0
  39. intel_npu_acceleration_library/external/openvino/frontend/__init__.py +34 -0
  40. intel_npu_acceleration_library/external/openvino/frontend/frontend.py +44 -0
  41. intel_npu_acceleration_library/external/openvino/frontend/jax/__init__.py +15 -0
  42. intel_npu_acceleration_library/external/openvino/frontend/jax/jaxpr_decoder.py +293 -0
  43. intel_npu_acceleration_library/external/openvino/frontend/jax/passes.py +65 -0
  44. intel_npu_acceleration_library/external/openvino/frontend/jax/utils.py +182 -0
  45. intel_npu_acceleration_library/external/openvino/frontend/onnx/__init__.py +15 -0
  46. intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp310-win_amd64.pyd +0 -0
  47. intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp311-win_amd64.pyd +0 -0
  48. intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp312-win_amd64.pyd +0 -0
  49. intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp38-win_amd64.pyd +0 -0
  50. intel_npu_acceleration_library/external/openvino/frontend/onnx/py_onnx_frontend.cp39-win_amd64.pyd +0 -0
  51. intel_npu_acceleration_library/external/openvino/frontend/paddle/__init__.py +15 -0
  52. intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp310-win_amd64.pyd +0 -0
  53. intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp311-win_amd64.pyd +0 -0
  54. intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp312-win_amd64.pyd +0 -0
  55. intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp38-win_amd64.pyd +0 -0
  56. intel_npu_acceleration_library/external/openvino/frontend/paddle/py_paddle_frontend.cp39-win_amd64.pyd +0 -0
  57. intel_npu_acceleration_library/external/openvino/frontend/pytorch/__init__.py +19 -0
  58. intel_npu_acceleration_library/external/openvino/frontend/pytorch/fx_decoder.py +370 -0
  59. intel_npu_acceleration_library/external/openvino/frontend/pytorch/gptq.py +180 -0
  60. intel_npu_acceleration_library/external/openvino/frontend/pytorch/module_extension.py +39 -0
  61. intel_npu_acceleration_library/external/openvino/frontend/pytorch/patch_model.py +118 -0
  62. intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp310-win_amd64.pyd +0 -0
  63. intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp311-win_amd64.pyd +0 -0
  64. intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp312-win_amd64.pyd +0 -0
  65. intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp38-win_amd64.pyd +0 -0
  66. intel_npu_acceleration_library/external/openvino/frontend/pytorch/py_pytorch_frontend.cp39-win_amd64.pyd +0 -0
  67. intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/backend.py +131 -0
  68. intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/backend_utils.py +85 -0
  69. intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/compile.py +141 -0
  70. intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/decompositions.py +116 -0
  71. intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/execute.py +189 -0
  72. intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/op_support.py +290 -0
  73. intel_npu_acceleration_library/external/openvino/frontend/pytorch/torchdynamo/partition.py +126 -0
  74. intel_npu_acceleration_library/external/openvino/frontend/pytorch/ts_decoder.py +568 -0
  75. intel_npu_acceleration_library/external/openvino/frontend/pytorch/utils.py +258 -0
  76. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/__init__.py +16 -0
  77. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/graph_iterator.py +116 -0
  78. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/node_decoder.py +219 -0
  79. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp310-win_amd64.pyd +0 -0
  80. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp311-win_amd64.pyd +0 -0
  81. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp312-win_amd64.pyd +0 -0
  82. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp38-win_amd64.pyd +0 -0
  83. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/py_tensorflow_frontend.cp39-win_amd64.pyd +0 -0
  84. intel_npu_acceleration_library/external/openvino/frontend/tensorflow/utils.py +481 -0
  85. intel_npu_acceleration_library/external/openvino/helpers/__init__.py +6 -0
  86. intel_npu_acceleration_library/external/openvino/helpers/packing.py +87 -0
  87. intel_npu_acceleration_library/external/openvino/preprocess/README.md +60 -0
  88. intel_npu_acceleration_library/external/openvino/preprocess/__init__.py +28 -0
  89. intel_npu_acceleration_library/external/openvino/preprocess/torchvision/__init__.py +15 -0
  90. intel_npu_acceleration_library/external/openvino/preprocess/torchvision/preprocess_converter.py +47 -0
  91. intel_npu_acceleration_library/external/openvino/preprocess/torchvision/requirements.txt +5 -0
  92. intel_npu_acceleration_library/external/openvino/preprocess/torchvision/torchvision_preprocessing.py +347 -0
  93. intel_npu_acceleration_library/external/openvino/properties/__init__.py +22 -0
  94. intel_npu_acceleration_library/external/openvino/properties/_properties.py +55 -0
  95. intel_npu_acceleration_library/external/openvino/properties/device/__init__.py +14 -0
  96. intel_npu_acceleration_library/external/openvino/properties/hint/__init__.py +15 -0
  97. intel_npu_acceleration_library/external/openvino/properties/intel_auto/__init__.py +12 -0
  98. intel_npu_acceleration_library/external/openvino/properties/intel_cpu/__init__.py +8 -0
  99. intel_npu_acceleration_library/external/openvino/properties/intel_gpu/__init__.py +12 -0
  100. intel_npu_acceleration_library/external/openvino/properties/intel_gpu/hint/__init__.py +11 -0
  101. intel_npu_acceleration_library/external/openvino/properties/log/__init__.py +11 -0
  102. intel_npu_acceleration_library/external/openvino/properties/streams/__init__.py +11 -0
  103. intel_npu_acceleration_library/external/openvino/runtime/__init__.py +85 -0
  104. intel_npu_acceleration_library/external/openvino/runtime/exceptions.py +17 -0
  105. intel_npu_acceleration_library/external/openvino/runtime/ie_api.py +631 -0
  106. intel_npu_acceleration_library/external/openvino/runtime/op/__init__.py +19 -0
  107. intel_npu_acceleration_library/external/openvino/runtime/op/util/__init__.py +22 -0
  108. intel_npu_acceleration_library/external/openvino/runtime/opset1/__init__.py +112 -0
  109. intel_npu_acceleration_library/external/openvino/runtime/opset1/ops.py +3068 -0
  110. intel_npu_acceleration_library/external/openvino/runtime/opset10/__init__.py +179 -0
  111. intel_npu_acceleration_library/external/openvino/runtime/opset10/ops.py +173 -0
  112. intel_npu_acceleration_library/external/openvino/runtime/opset11/__init__.py +179 -0
  113. intel_npu_acceleration_library/external/openvino/runtime/opset11/ops.py +107 -0
  114. intel_npu_acceleration_library/external/openvino/runtime/opset12/__init__.py +180 -0
  115. intel_npu_acceleration_library/external/openvino/runtime/opset12/ops.py +120 -0
  116. intel_npu_acceleration_library/external/openvino/runtime/opset13/__init__.py +188 -0
  117. intel_npu_acceleration_library/external/openvino/runtime/opset13/ops.py +398 -0
  118. intel_npu_acceleration_library/external/openvino/runtime/opset14/__init__.py +190 -0
  119. intel_npu_acceleration_library/external/openvino/runtime/opset14/ops.py +171 -0
  120. intel_npu_acceleration_library/external/openvino/runtime/opset15/__init__.py +17 -0
  121. intel_npu_acceleration_library/external/openvino/runtime/opset15/ops.py +276 -0
  122. intel_npu_acceleration_library/external/openvino/runtime/opset2/__init__.py +118 -0
  123. intel_npu_acceleration_library/external/openvino/runtime/opset2/ops.py +216 -0
  124. intel_npu_acceleration_library/external/openvino/runtime/opset3/__init__.py +134 -0
  125. intel_npu_acceleration_library/external/openvino/runtime/opset3/ops.py +638 -0
  126. intel_npu_acceleration_library/external/openvino/runtime/opset4/__init__.py +145 -0
  127. intel_npu_acceleration_library/external/openvino/runtime/opset4/ops.py +464 -0
  128. intel_npu_acceleration_library/external/openvino/runtime/opset5/__init__.py +152 -0
  129. intel_npu_acceleration_library/external/openvino/runtime/opset5/ops.py +372 -0
  130. intel_npu_acceleration_library/external/openvino/runtime/opset6/__init__.py +154 -0
  131. intel_npu_acceleration_library/external/openvino/runtime/opset6/ops.py +215 -0
  132. intel_npu_acceleration_library/external/openvino/runtime/opset7/__init__.py +158 -0
  133. intel_npu_acceleration_library/external/openvino/runtime/opset7/ops.py +169 -0
  134. intel_npu_acceleration_library/external/openvino/runtime/opset8/__init__.py +169 -0
  135. intel_npu_acceleration_library/external/openvino/runtime/opset8/ops.py +787 -0
  136. intel_npu_acceleration_library/external/openvino/runtime/opset9/__init__.py +175 -0
  137. intel_npu_acceleration_library/external/openvino/runtime/opset9/ops.py +341 -0
  138. intel_npu_acceleration_library/external/openvino/runtime/opset_utils.py +22 -0
  139. intel_npu_acceleration_library/external/openvino/runtime/passes/__init__.py +19 -0
  140. intel_npu_acceleration_library/external/openvino/runtime/passes/graph_rewrite.py +33 -0
  141. intel_npu_acceleration_library/external/openvino/runtime/passes/manager.py +26 -0
  142. intel_npu_acceleration_library/external/openvino/runtime/properties/__init__.py +40 -0
  143. intel_npu_acceleration_library/external/openvino/runtime/properties/hint/__init__.py +25 -0
  144. intel_npu_acceleration_library/external/openvino/runtime/utils/__init__.py +7 -0
  145. intel_npu_acceleration_library/external/openvino/runtime/utils/broadcasting.py +44 -0
  146. intel_npu_acceleration_library/external/openvino/runtime/utils/data_helpers/__init__.py +8 -0
  147. intel_npu_acceleration_library/external/openvino/runtime/utils/data_helpers/data_dispatcher.py +447 -0
  148. intel_npu_acceleration_library/external/openvino/runtime/utils/data_helpers/wrappers.py +148 -0
  149. intel_npu_acceleration_library/external/openvino/runtime/utils/decorators.py +156 -0
  150. intel_npu_acceleration_library/external/openvino/runtime/utils/input_validation.py +133 -0
  151. intel_npu_acceleration_library/external/openvino/runtime/utils/node_factory.py +127 -0
  152. intel_npu_acceleration_library/external/openvino/runtime/utils/reduction.py +25 -0
  153. intel_npu_acceleration_library/external/openvino/runtime/utils/types.py +175 -0
  154. intel_npu_acceleration_library/external/openvino/tools/__init__.py +4 -0
  155. intel_npu_acceleration_library/external/openvino/tools/benchmark/__init__.py +3 -0
  156. intel_npu_acceleration_library/external/openvino/tools/benchmark/benchmark.py +186 -0
  157. intel_npu_acceleration_library/external/openvino/tools/benchmark/main.py +695 -0
  158. intel_npu_acceleration_library/external/openvino/tools/benchmark/parameters.py +199 -0
  159. intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/__init__.py +3 -0
  160. intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/constants.py +26 -0
  161. intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/inputs_filling.py +482 -0
  162. intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/logging.py +8 -0
  163. intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/statistics_report.py +296 -0
  164. intel_npu_acceleration_library/external/openvino/tools/benchmark/utils/utils.py +836 -0
  165. intel_npu_acceleration_library/external/openvino/tools/ovc/__init__.py +20 -0
  166. intel_npu_acceleration_library/external/openvino/tools/ovc/__main__.py +10 -0
  167. intel_npu_acceleration_library/external/openvino/tools/ovc/cli_parser.py +633 -0
  168. intel_npu_acceleration_library/external/openvino/tools/ovc/convert.py +102 -0
  169. intel_npu_acceleration_library/external/openvino/tools/ovc/convert_data_type.py +82 -0
  170. intel_npu_acceleration_library/external/openvino/tools/ovc/convert_impl.py +550 -0
  171. intel_npu_acceleration_library/external/openvino/tools/ovc/environment_setup_utils.py +50 -0
  172. intel_npu_acceleration_library/external/openvino/tools/ovc/error.py +49 -0
  173. intel_npu_acceleration_library/external/openvino/tools/ovc/get_ov_update_message.py +16 -0
  174. intel_npu_acceleration_library/external/openvino/tools/ovc/help.py +45 -0
  175. intel_npu_acceleration_library/external/openvino/tools/ovc/logger.py +91 -0
  176. intel_npu_acceleration_library/external/openvino/tools/ovc/main.py +40 -0
  177. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/__init__.py +2 -0
  178. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/analysis.py +46 -0
  179. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/check_config.py +57 -0
  180. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/extractor.py +447 -0
  181. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/jax_frontend_utils.py +19 -0
  182. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/layout_utils.py +73 -0
  183. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/moc_emit_ir.py +32 -0
  184. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/offline_transformations.py +107 -0
  185. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/paddle_frontend_utils.py +83 -0
  186. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/pipeline.py +298 -0
  187. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/preprocessing.py +220 -0
  188. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/pytorch_frontend_utils.py +214 -0
  189. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/shape_utils.py +109 -0
  190. intel_npu_acceleration_library/external/openvino/tools/ovc/moc_frontend/type_utils.py +82 -0
  191. intel_npu_acceleration_library/external/openvino/tools/ovc/ovc.py +13 -0
  192. intel_npu_acceleration_library/external/openvino/tools/ovc/telemetry_params.py +6 -0
  193. intel_npu_acceleration_library/external/openvino/tools/ovc/telemetry_stub.py +28 -0
  194. intel_npu_acceleration_library/external/openvino/tools/ovc/telemetry_utils.py +118 -0
  195. intel_npu_acceleration_library/external/openvino/tools/ovc/utils.py +196 -0
  196. intel_npu_acceleration_library/external/openvino/tools/ovc/version.py +80 -0
  197. intel_npu_acceleration_library/external/openvino/torch/__init__.py +5 -0
  198. intel_npu_acceleration_library/external/openvino/utils.py +115 -0
  199. intel_npu_acceleration_library/functional/__init__.py +8 -0
  200. intel_npu_acceleration_library/functional/scaled_dot_product_attention.py +47 -0
  201. intel_npu_acceleration_library/lib/Release/cache.json +113732 -0
  202. intel_npu_acceleration_library/lib/Release/intel_npu_acceleration_library.dll +0 -0
  203. intel_npu_acceleration_library/lib/Release/openvino.dll +0 -0
  204. intel_npu_acceleration_library/lib/Release/openvino_auto_batch_plugin.dll +0 -0
  205. intel_npu_acceleration_library/lib/Release/openvino_auto_plugin.dll +0 -0
  206. intel_npu_acceleration_library/lib/Release/openvino_c.dll +0 -0
  207. intel_npu_acceleration_library/lib/Release/openvino_hetero_plugin.dll +0 -0
  208. intel_npu_acceleration_library/lib/Release/openvino_intel_cpu_plugin.dll +0 -0
  209. intel_npu_acceleration_library/lib/Release/openvino_intel_gpu_plugin.dll +0 -0
  210. intel_npu_acceleration_library/lib/Release/openvino_intel_npu_plugin.dll +0 -0
  211. intel_npu_acceleration_library/lib/Release/openvino_ir_frontend.dll +0 -0
  212. intel_npu_acceleration_library/lib/Release/openvino_onnx_frontend.dll +0 -0
  213. intel_npu_acceleration_library/lib/Release/openvino_paddle_frontend.dll +0 -0
  214. intel_npu_acceleration_library/lib/Release/openvino_pytorch_frontend.dll +0 -0
  215. intel_npu_acceleration_library/lib/Release/openvino_tensorflow_frontend.dll +0 -0
  216. intel_npu_acceleration_library/lib/Release/openvino_tensorflow_lite_frontend.dll +0 -0
  217. intel_npu_acceleration_library/lib/Release/tbb12.dll +0 -0
  218. intel_npu_acceleration_library/lib/Release/tbb12_debug.dll +0 -0
  219. intel_npu_acceleration_library/lib/Release/tbbbind_2_5.dll +0 -0
  220. intel_npu_acceleration_library/lib/Release/tbbbind_2_5_debug.dll +0 -0
  221. intel_npu_acceleration_library/lib/Release/tbbmalloc.dll +0 -0
  222. intel_npu_acceleration_library/lib/Release/tbbmalloc_debug.dll +0 -0
  223. intel_npu_acceleration_library/lib/Release/tbbmalloc_proxy.dll +0 -0
  224. intel_npu_acceleration_library/lib/Release/tbbmalloc_proxy_debug.dll +0 -0
  225. intel_npu_acceleration_library/modelling.py +150 -0
  226. intel_npu_acceleration_library/nn/__init__.py +20 -0
  227. intel_npu_acceleration_library/nn/autograd.py +68 -0
  228. intel_npu_acceleration_library/nn/conv.py +257 -0
  229. intel_npu_acceleration_library/nn/functional.py +1207 -0
  230. intel_npu_acceleration_library/nn/linear.py +162 -0
  231. intel_npu_acceleration_library/nn/llm.py +417 -0
  232. intel_npu_acceleration_library/nn/module.py +393 -0
  233. intel_npu_acceleration_library/optimizations.py +157 -0
  234. intel_npu_acceleration_library/quantization.py +174 -0
@@ -0,0 +1,179 @@
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.opset8.ops import adaptive_avg_pool
10
+ from openvino.runtime.opset8.ops import adaptive_max_pool
11
+ from openvino.runtime.opset1.ops import add
12
+ from openvino.runtime.opset1.ops import asin
13
+ from openvino.runtime.opset4.ops import asinh
14
+ from openvino.runtime.opset6.ops import assign
15
+ from openvino.runtime.opset1.ops import atan
16
+ from openvino.runtime.opset4.ops import atanh
17
+ from openvino.runtime.opset1.ops import avg_pool
18
+ from openvino.runtime.opset5.ops import batch_norm_inference
19
+ from openvino.runtime.opset2.ops import batch_to_space
20
+ from openvino.runtime.opset1.ops import binary_convolution
21
+ from openvino.runtime.opset3.ops import broadcast
22
+ from openvino.runtime.opset3.ops import bucketize
23
+ from openvino.runtime.opset1.ops import ceiling
24
+ from openvino.runtime.opset1.ops import ceiling as ceil
25
+ from openvino.runtime.opset1.ops import clamp
26
+ from openvino.runtime.opset1.ops import concat
27
+ from openvino.runtime.opset1.ops import constant
28
+ from openvino.runtime.opset1.ops import convert
29
+ from openvino.runtime.opset1.ops import convert_like
30
+ from openvino.runtime.opset1.ops import convolution
31
+ from openvino.runtime.opset1.ops import convolution_backprop_data
32
+ from openvino.runtime.opset1.ops import cos
33
+ from openvino.runtime.opset1.ops import cosh
34
+ from openvino.runtime.opset1.ops import ctc_greedy_decoder
35
+ from openvino.runtime.opset6.ops import ctc_greedy_decoder_seq_len
36
+ from openvino.runtime.opset4.ops import ctc_loss
37
+ from openvino.runtime.opset3.ops import cum_sum
38
+ from openvino.runtime.opset3.ops import cum_sum as cumsum
39
+ from openvino.runtime.opset8.ops import deformable_convolution
40
+ from openvino.runtime.opset1.ops import deformable_psroi_pooling
41
+ from openvino.runtime.opset1.ops import depth_to_space
42
+ from openvino.runtime.opset8.ops import detection_output
43
+ from openvino.runtime.opset7.ops import dft
44
+ from openvino.runtime.opset1.ops import divide
45
+ from openvino.runtime.opset7.ops import einsum
46
+ from openvino.runtime.opset1.ops import elu
47
+ from openvino.runtime.opset3.ops import embedding_bag_offsets_sum
48
+ from openvino.runtime.opset3.ops import embedding_bag_packed_sum
49
+ from openvino.runtime.opset3.ops import embedding_segments_sum
50
+ from openvino.runtime.opset3.ops import extract_image_patches
51
+ from openvino.runtime.opset1.ops import equal
52
+ from openvino.runtime.opset1.ops import erf
53
+ from openvino.runtime.opset1.ops import exp
54
+ from openvino.runtime.opset9.ops import eye
55
+ from openvino.runtime.opset1.ops import fake_quantize
56
+ from openvino.runtime.opset1.ops import floor
57
+ from openvino.runtime.opset1.ops import floor_mod
58
+ from openvino.runtime.opset8.ops import gather
59
+ from openvino.runtime.opset6.ops import gather_elements
60
+ from openvino.runtime.opset8.ops import gather_nd
61
+ from openvino.runtime.opset1.ops import gather_tree
62
+ from openvino.runtime.opset7.ops import gelu
63
+ from openvino.runtime.opset9.ops import generate_proposals
64
+ from openvino.runtime.opset1.ops import greater
65
+ from openvino.runtime.opset1.ops import greater_equal
66
+ from openvino.runtime.opset9.ops import grid_sample
67
+ from openvino.runtime.opset1.ops import grn
68
+ from openvino.runtime.opset1.ops import group_convolution
69
+ from openvino.runtime.opset1.ops import group_convolution_backprop_data
70
+ from openvino.runtime.opset3.ops import gru_cell
71
+ from openvino.runtime.opset5.ops import gru_sequence
72
+ from openvino.runtime.opset1.ops import hard_sigmoid
73
+ from openvino.runtime.opset5.ops import hsigmoid
74
+ from openvino.runtime.opset4.ops import hswish
75
+ from openvino.runtime.opset7.ops import idft
76
+ from openvino.runtime.opset8.ops import if_op
77
+ from openvino.runtime.opset10.ops import interpolate
78
+ from openvino.runtime.opset9.ops import irdft
79
+ from openvino.runtime.opset10.ops import is_finite
80
+ from openvino.runtime.opset10.ops import is_inf
81
+ from openvino.runtime.opset10.ops import is_nan
82
+ from openvino.runtime.opset8.ops import i420_to_bgr
83
+ from openvino.runtime.opset8.ops import i420_to_rgb
84
+ from openvino.runtime.opset1.ops import less
85
+ from openvino.runtime.opset1.ops import less_equal
86
+ from openvino.runtime.opset1.ops import log
87
+ from openvino.runtime.opset1.ops import logical_and
88
+ from openvino.runtime.opset1.ops import logical_not
89
+ from openvino.runtime.opset1.ops import logical_or
90
+ from openvino.runtime.opset1.ops import logical_xor
91
+ from openvino.runtime.opset5.ops import log_softmax
92
+ from openvino.runtime.opset5.ops import loop
93
+ from openvino.runtime.opset1.ops import lrn
94
+ from openvino.runtime.opset4.ops import lstm_cell
95
+ from openvino.runtime.opset5.ops import lstm_sequence
96
+ from openvino.runtime.opset1.ops import matmul
97
+ from openvino.runtime.opset8.ops import matrix_nms
98
+ from openvino.runtime.opset8.ops import max_pool
99
+ from openvino.runtime.opset1.ops import maximum
100
+ from openvino.runtime.opset1.ops import minimum
101
+ from openvino.runtime.opset4.ops import mish
102
+ from openvino.runtime.opset1.ops import mod
103
+ from openvino.runtime.opset9.ops import multiclass_nms
104
+ from openvino.runtime.opset1.ops import multiply
105
+ from openvino.runtime.opset6.ops import mvn
106
+ from openvino.runtime.opset1.ops import negative
107
+ from openvino.runtime.opset9.ops import non_max_suppression
108
+ from openvino.runtime.opset3.ops import non_zero
109
+ from openvino.runtime.opset1.ops import normalize_l2
110
+ from openvino.runtime.opset1.ops import not_equal
111
+ from openvino.runtime.opset8.ops import nv12_to_bgr
112
+ from openvino.runtime.opset8.ops import nv12_to_rgb
113
+ from openvino.runtime.opset1.ops import one_hot
114
+ from openvino.runtime.opset1.ops import pad
115
+ from openvino.runtime.opset1.ops import parameter
116
+ from openvino.runtime.opset1.ops import power
117
+ from openvino.runtime.opset1.ops import prelu
118
+ from openvino.runtime.opset8.ops import prior_box
119
+ from openvino.runtime.opset1.ops import prior_box_clustered
120
+ from openvino.runtime.opset1.ops import psroi_pooling
121
+ from openvino.runtime.opset4.ops import proposal
122
+ from openvino.runtime.opset1.ops import range
123
+ from openvino.runtime.opset8.ops import random_uniform
124
+ from openvino.runtime.opset9.ops import rdft
125
+ from openvino.runtime.opset6.ops import read_value
126
+ from openvino.runtime.opset4.ops import reduce_l1
127
+ from openvino.runtime.opset4.ops import reduce_l2
128
+ from openvino.runtime.opset1.ops import reduce_logical_and
129
+ from openvino.runtime.opset1.ops import reduce_logical_or
130
+ from openvino.runtime.opset1.ops import reduce_max
131
+ from openvino.runtime.opset1.ops import reduce_mean
132
+ from openvino.runtime.opset1.ops import reduce_min
133
+ from openvino.runtime.opset1.ops import reduce_prod
134
+ from openvino.runtime.opset1.ops import reduce_sum
135
+ from openvino.runtime.opset1.ops import region_yolo
136
+ from openvino.runtime.opset2.ops import reorg_yolo
137
+ from openvino.runtime.opset1.ops import relu
138
+ from openvino.runtime.opset1.ops import reshape
139
+ from openvino.runtime.opset1.ops import result
140
+ from openvino.runtime.opset1.ops import reverse_sequence
141
+ from openvino.runtime.opset3.ops import rnn_cell
142
+ from openvino.runtime.opset5.ops import rnn_sequence
143
+ from openvino.runtime.opset9.ops import roi_align
144
+ from openvino.runtime.opset2.ops import roi_pooling
145
+ from openvino.runtime.opset7.ops import roll
146
+ from openvino.runtime.opset5.ops import round
147
+ from openvino.runtime.opset3.ops import scatter_elements_update
148
+ from openvino.runtime.opset4.ops import scatter_nd_update
149
+ from openvino.runtime.opset3.ops import scatter_update
150
+ from openvino.runtime.opset1.ops import select
151
+ from openvino.runtime.opset1.ops import selu
152
+ from openvino.runtime.opset3.ops import shape_of
153
+ from openvino.runtime.opset3.ops import shuffle_channels
154
+ from openvino.runtime.opset1.ops import sigmoid
155
+ from openvino.runtime.opset1.ops import sign
156
+ from openvino.runtime.opset1.ops import sin
157
+ from openvino.runtime.opset1.ops import sinh
158
+ from openvino.runtime.opset8.ops import slice
159
+ from openvino.runtime.opset8.ops import softmax
160
+ from openvino.runtime.opset4.ops import softplus
161
+ from openvino.runtime.opset9.ops import softsign
162
+ from openvino.runtime.opset2.ops import space_to_batch
163
+ from openvino.runtime.opset1.ops import space_to_depth
164
+ from openvino.runtime.opset1.ops import split
165
+ from openvino.runtime.opset1.ops import sqrt
166
+ from openvino.runtime.opset1.ops import squared_difference
167
+ from openvino.runtime.opset1.ops import squeeze
168
+ from openvino.runtime.opset1.ops import strided_slice
169
+ from openvino.runtime.opset1.ops import subtract
170
+ from openvino.runtime.opset4.ops import swish
171
+ from openvino.runtime.opset1.ops import tan
172
+ from openvino.runtime.opset1.ops import tanh
173
+ from openvino.runtime.opset1.ops import tensor_iterator
174
+ from openvino.runtime.opset1.ops import tile
175
+ from openvino.runtime.opset3.ops import topk
176
+ from openvino.runtime.opset1.ops import transpose
177
+ from openvino.runtime.opset10.ops import unique
178
+ from openvino.runtime.opset1.ops import unsqueeze
179
+ from openvino.runtime.opset1.ops import variadic_split
@@ -0,0 +1,173 @@
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 functools import partial
7
+ from typing import List, Optional
8
+
9
+ from openvino.runtime import Node
10
+ from openvino.runtime.opset_utils import _get_node_factory
11
+ from openvino.runtime.utils.decorators import nameable_op
12
+ from openvino.runtime.utils.types import (
13
+ NodeInput,
14
+ as_nodes,
15
+ as_node,
16
+ make_constant_node,
17
+ )
18
+
19
+ _get_node_factory_opset4 = partial(_get_node_factory, "opset4")
20
+ _get_node_factory_opset10 = partial(_get_node_factory, "opset10")
21
+
22
+ # -------------------------------------------- ops ------------------------------------------------
23
+
24
+
25
+ @nameable_op
26
+ def interpolate(
27
+ image: NodeInput,
28
+ output_shape: NodeInput,
29
+ scales: NodeInput,
30
+ mode: str,
31
+ shape_calculation_mode: str,
32
+ pads_begin: Optional[List[int]] = None,
33
+ pads_end: Optional[List[int]] = None,
34
+ coordinate_transformation_mode: str = "half_pixel",
35
+ nearest_mode: str = "round_prefer_floor",
36
+ antialias: bool = False,
37
+ cube_coeff: float = -0.75,
38
+ axes: Optional[NodeInput] = None,
39
+ name: Optional[str] = None,
40
+ ) -> Node:
41
+ """Perform interpolation of independent slices in input tensor.
42
+
43
+ :param image: The node providing input tensor with data for interpolation.
44
+ :param output_shape: 1D tensor describing output shape for spatial axes.
45
+ :param scales: 1D tensor describing scales for spatial axes.
46
+ :param mode: Specifies type of interpolation. Possible values are: nearest, linear,
47
+ linear_onnx, cubic.
48
+ :param shape_calculation_mode:
49
+ Specifies which input, sizes or scales, is used to calculate an output
50
+ shape.
51
+ :param pads_begin: Specifies the number of pixels to add to the beginning of the image
52
+ being interpolated. Default is None.
53
+ :param pads_end: Specifies the number of pixels to add to the end of the image being
54
+ interpolated. Default is None.
55
+ :param coordinate_transformation_mode:
56
+ Specifies how to transform the coordinate in the resized tensor to the
57
+ coordinate in the original tensor. Default is "half_pixel".
58
+ :param nearest_mode: Specifies round mode when mode == nearest and is used only when
59
+ mode == nearest. Default is "round_prefer_floor".
60
+ :param antialias: Specifies whether to perform anti-aliasing. Default is False.
61
+ :param cube_coeff: Specifies the parameter a for cubic interpolation. Default is -0.75.
62
+ :param axes: 1D tensor specifying dimension indices where interpolation is applied.
63
+ Default is None.
64
+ :param name: Optional name for the output node. Default is None.
65
+ :return: Node representing interpolation operation.
66
+ """
67
+ attrs = {
68
+ "mode": mode,
69
+ "shape_calculation_mode": shape_calculation_mode,
70
+ "coordinate_transformation_mode": coordinate_transformation_mode,
71
+ "nearest_mode": nearest_mode,
72
+ "antialias": antialias,
73
+ "cube_coeff": cube_coeff,
74
+ }
75
+
76
+ attrs["pads_begin"] = [] if pads_begin is None else pads_begin
77
+ attrs["pads_end"] = [] if pads_end is None else pads_end
78
+
79
+ inputs = as_nodes(image, output_shape, scales, name=name) if axes is None else as_nodes(image, output_shape, scales, axes, name=name)
80
+
81
+ # This is an update of the operator version, so even though this is opset 10,
82
+ # the operator is taken from opset 4.
83
+ return _get_node_factory_opset4().create("Interpolate", inputs, attrs)
84
+
85
+
86
+ @nameable_op
87
+ def is_finite(data: NodeInput, name: Optional[str] = None) -> Node:
88
+ """Performs element-wise mapping from NaN and Infinity to False. Other values are mapped to True.
89
+
90
+ :param data: A tensor of floating-point numeric type and arbitrary shape.
91
+ :param name: Optional name for the output node. The default is None.
92
+ :return: Node representing is_finite operation.
93
+ """
94
+ return _get_node_factory_opset10().create("IsFinite", as_nodes(data, name=name))
95
+
96
+
97
+ @nameable_op
98
+ def is_inf(
99
+ data: NodeInput,
100
+ attributes: Optional[dict] = None,
101
+ name: Optional[str] = None,
102
+ ) -> Node:
103
+ """Return a node which performs IsInf operation.
104
+
105
+ :param data: The input tensor.
106
+ :param attributes: Optional dictionary containing IsInf attributes.
107
+ :param name: Optional name of the node.
108
+
109
+ Available attributes:
110
+
111
+ * detect_negative Specifies whether to map negative infinities to true in output map.
112
+ Range of values: true, false
113
+ Default value: true
114
+ Required: no
115
+ * detect_positive Specifies whether to map positive infinities to true in output map.
116
+ Range of values: true, false
117
+ Default value: true
118
+ Required: no
119
+
120
+ :return: A new IsInf node.
121
+ """
122
+ if not attributes:
123
+ attributes = {}
124
+ return _get_node_factory_opset10().create("IsInf", as_nodes(data, name=name), attributes)
125
+
126
+
127
+ @nameable_op
128
+ def is_nan(data: NodeInput, name: Optional[str] = None) -> Node:
129
+ """Performs element-wise mapping from NaN to True. Other values are mapped to False.
130
+
131
+ :param data: A tensor of floating point numeric type and arbitrary shape.
132
+ :param name: Optional name for the output node. Default is None.
133
+ :return: Node representing is_nan operation.
134
+ """
135
+ return _get_node_factory_opset10().create("IsNaN", as_nodes(data, name=name))
136
+
137
+
138
+ @nameable_op
139
+ def unique(
140
+ data: NodeInput,
141
+ axis: Optional[NodeInput] = None,
142
+ sorted: Optional[bool] = True,
143
+ index_element_type: Optional[str] = "i64",
144
+ count_element_type: Optional[str] = "i64",
145
+ name: Optional[str] = None,
146
+ ) -> Node:
147
+ """Operator which selects and returns unique elements or unique slices of the input tensor.
148
+
149
+ :param data: Input data tensor.
150
+ :param axis: (Optional) An input tensor containing the axis value.
151
+ If not provided or None, data input is considered as a flattened tensor.
152
+ Default value: None.
153
+ :param sorted: (Optional) Controls the order of the returned unique values,
154
+ sorts ascendingly when true.
155
+ Default value: True.
156
+ :param index_element_type: (Optional) The data type set for outputs containing indices.
157
+ Default value: "i64".
158
+ :param count_element_type: (Optional) The data type set for the output with repetition count.
159
+ Default value: "i64".
160
+ :param name: (Optional) A name for the output node. Default value: None.
161
+ :return: Node representing Unique operation.
162
+ """
163
+ if axis is None:
164
+ inputs = as_nodes(data, name=name)
165
+ else:
166
+ inputs = as_nodes(data, axis, name=name)
167
+
168
+ attributes = {
169
+ "sorted": sorted,
170
+ "index_element_type": index_element_type,
171
+ "count_element_type": count_element_type,
172
+ }
173
+ return _get_node_factory_opset10().create("Unique", inputs, attributes)
@@ -0,0 +1,179 @@
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.opset8.ops import adaptive_avg_pool
10
+ from openvino.runtime.opset8.ops import adaptive_max_pool
11
+ from openvino.runtime.opset1.ops import add
12
+ from openvino.runtime.opset1.ops import asin
13
+ from openvino.runtime.opset4.ops import asinh
14
+ from openvino.runtime.opset6.ops import assign
15
+ from openvino.runtime.opset1.ops import atan
16
+ from openvino.runtime.opset4.ops import atanh
17
+ from openvino.runtime.opset1.ops import avg_pool
18
+ from openvino.runtime.opset5.ops import batch_norm_inference
19
+ from openvino.runtime.opset2.ops import batch_to_space
20
+ from openvino.runtime.opset1.ops import binary_convolution
21
+ from openvino.runtime.opset3.ops import broadcast
22
+ from openvino.runtime.opset3.ops import bucketize
23
+ from openvino.runtime.opset1.ops import ceiling
24
+ from openvino.runtime.opset1.ops import ceiling as ceil
25
+ from openvino.runtime.opset1.ops import clamp
26
+ from openvino.runtime.opset1.ops import concat
27
+ from openvino.runtime.opset1.ops import constant
28
+ from openvino.runtime.opset1.ops import convert
29
+ from openvino.runtime.opset1.ops import convert_like
30
+ from openvino.runtime.opset1.ops import convolution
31
+ from openvino.runtime.opset1.ops import convolution_backprop_data
32
+ from openvino.runtime.opset1.ops import cos
33
+ from openvino.runtime.opset1.ops import cosh
34
+ from openvino.runtime.opset1.ops import ctc_greedy_decoder
35
+ from openvino.runtime.opset6.ops import ctc_greedy_decoder_seq_len
36
+ from openvino.runtime.opset4.ops import ctc_loss
37
+ from openvino.runtime.opset3.ops import cum_sum
38
+ from openvino.runtime.opset3.ops import cum_sum as cumsum
39
+ from openvino.runtime.opset8.ops import deformable_convolution
40
+ from openvino.runtime.opset1.ops import deformable_psroi_pooling
41
+ from openvino.runtime.opset1.ops import depth_to_space
42
+ from openvino.runtime.opset8.ops import detection_output
43
+ from openvino.runtime.opset7.ops import dft
44
+ from openvino.runtime.opset1.ops import divide
45
+ from openvino.runtime.opset7.ops import einsum
46
+ from openvino.runtime.opset1.ops import elu
47
+ from openvino.runtime.opset3.ops import embedding_bag_offsets_sum
48
+ from openvino.runtime.opset3.ops import embedding_bag_packed_sum
49
+ from openvino.runtime.opset3.ops import embedding_segments_sum
50
+ from openvino.runtime.opset3.ops import extract_image_patches
51
+ from openvino.runtime.opset1.ops import equal
52
+ from openvino.runtime.opset1.ops import erf
53
+ from openvino.runtime.opset1.ops import exp
54
+ from openvino.runtime.opset9.ops import eye
55
+ from openvino.runtime.opset1.ops import fake_quantize
56
+ from openvino.runtime.opset1.ops import floor
57
+ from openvino.runtime.opset1.ops import floor_mod
58
+ from openvino.runtime.opset8.ops import gather
59
+ from openvino.runtime.opset6.ops import gather_elements
60
+ from openvino.runtime.opset8.ops import gather_nd
61
+ from openvino.runtime.opset1.ops import gather_tree
62
+ from openvino.runtime.opset7.ops import gelu
63
+ from openvino.runtime.opset9.ops import generate_proposals
64
+ from openvino.runtime.opset1.ops import greater
65
+ from openvino.runtime.opset1.ops import greater_equal
66
+ from openvino.runtime.opset9.ops import grid_sample
67
+ from openvino.runtime.opset1.ops import grn
68
+ from openvino.runtime.opset1.ops import group_convolution
69
+ from openvino.runtime.opset1.ops import group_convolution_backprop_data
70
+ from openvino.runtime.opset3.ops import gru_cell
71
+ from openvino.runtime.opset5.ops import gru_sequence
72
+ from openvino.runtime.opset1.ops import hard_sigmoid
73
+ from openvino.runtime.opset5.ops import hsigmoid
74
+ from openvino.runtime.opset4.ops import hswish
75
+ from openvino.runtime.opset7.ops import idft
76
+ from openvino.runtime.opset8.ops import if_op
77
+ from openvino.runtime.opset11.ops import interpolate
78
+ from openvino.runtime.opset9.ops import irdft
79
+ from openvino.runtime.opset10.ops import is_finite
80
+ from openvino.runtime.opset10.ops import is_inf
81
+ from openvino.runtime.opset10.ops import is_nan
82
+ from openvino.runtime.opset8.ops import i420_to_bgr
83
+ from openvino.runtime.opset8.ops import i420_to_rgb
84
+ from openvino.runtime.opset1.ops import less
85
+ from openvino.runtime.opset1.ops import less_equal
86
+ from openvino.runtime.opset1.ops import log
87
+ from openvino.runtime.opset1.ops import logical_and
88
+ from openvino.runtime.opset1.ops import logical_not
89
+ from openvino.runtime.opset1.ops import logical_or
90
+ from openvino.runtime.opset1.ops import logical_xor
91
+ from openvino.runtime.opset5.ops import log_softmax
92
+ from openvino.runtime.opset5.ops import loop
93
+ from openvino.runtime.opset1.ops import lrn
94
+ from openvino.runtime.opset4.ops import lstm_cell
95
+ from openvino.runtime.opset5.ops import lstm_sequence
96
+ from openvino.runtime.opset1.ops import matmul
97
+ from openvino.runtime.opset8.ops import matrix_nms
98
+ from openvino.runtime.opset8.ops import max_pool
99
+ from openvino.runtime.opset1.ops import maximum
100
+ from openvino.runtime.opset1.ops import minimum
101
+ from openvino.runtime.opset4.ops import mish
102
+ from openvino.runtime.opset1.ops import mod
103
+ from openvino.runtime.opset9.ops import multiclass_nms
104
+ from openvino.runtime.opset1.ops import multiply
105
+ from openvino.runtime.opset6.ops import mvn
106
+ from openvino.runtime.opset1.ops import negative
107
+ from openvino.runtime.opset9.ops import non_max_suppression
108
+ from openvino.runtime.opset3.ops import non_zero
109
+ from openvino.runtime.opset1.ops import normalize_l2
110
+ from openvino.runtime.opset1.ops import not_equal
111
+ from openvino.runtime.opset8.ops import nv12_to_bgr
112
+ from openvino.runtime.opset8.ops import nv12_to_rgb
113
+ from openvino.runtime.opset1.ops import one_hot
114
+ from openvino.runtime.opset1.ops import pad
115
+ from openvino.runtime.opset1.ops import parameter
116
+ from openvino.runtime.opset1.ops import power
117
+ from openvino.runtime.opset1.ops import prelu
118
+ from openvino.runtime.opset8.ops import prior_box
119
+ from openvino.runtime.opset1.ops import prior_box_clustered
120
+ from openvino.runtime.opset1.ops import psroi_pooling
121
+ from openvino.runtime.opset4.ops import proposal
122
+ from openvino.runtime.opset1.ops import range
123
+ from openvino.runtime.opset8.ops import random_uniform
124
+ from openvino.runtime.opset9.ops import rdft
125
+ from openvino.runtime.opset6.ops import read_value
126
+ from openvino.runtime.opset4.ops import reduce_l1
127
+ from openvino.runtime.opset4.ops import reduce_l2
128
+ from openvino.runtime.opset1.ops import reduce_logical_and
129
+ from openvino.runtime.opset1.ops import reduce_logical_or
130
+ from openvino.runtime.opset1.ops import reduce_max
131
+ from openvino.runtime.opset1.ops import reduce_mean
132
+ from openvino.runtime.opset1.ops import reduce_min
133
+ from openvino.runtime.opset1.ops import reduce_prod
134
+ from openvino.runtime.opset1.ops import reduce_sum
135
+ from openvino.runtime.opset1.ops import region_yolo
136
+ from openvino.runtime.opset2.ops import reorg_yolo
137
+ from openvino.runtime.opset1.ops import relu
138
+ from openvino.runtime.opset1.ops import reshape
139
+ from openvino.runtime.opset1.ops import result
140
+ from openvino.runtime.opset1.ops import reverse_sequence
141
+ from openvino.runtime.opset3.ops import rnn_cell
142
+ from openvino.runtime.opset5.ops import rnn_sequence
143
+ from openvino.runtime.opset9.ops import roi_align
144
+ from openvino.runtime.opset2.ops import roi_pooling
145
+ from openvino.runtime.opset7.ops import roll
146
+ from openvino.runtime.opset5.ops import round
147
+ from openvino.runtime.opset3.ops import scatter_elements_update
148
+ from openvino.runtime.opset4.ops import scatter_nd_update
149
+ from openvino.runtime.opset3.ops import scatter_update
150
+ from openvino.runtime.opset1.ops import select
151
+ from openvino.runtime.opset1.ops import selu
152
+ from openvino.runtime.opset3.ops import shape_of
153
+ from openvino.runtime.opset3.ops import shuffle_channels
154
+ from openvino.runtime.opset1.ops import sigmoid
155
+ from openvino.runtime.opset1.ops import sign
156
+ from openvino.runtime.opset1.ops import sin
157
+ from openvino.runtime.opset1.ops import sinh
158
+ from openvino.runtime.opset8.ops import slice
159
+ from openvino.runtime.opset8.ops import softmax
160
+ from openvino.runtime.opset4.ops import softplus
161
+ from openvino.runtime.opset9.ops import softsign
162
+ from openvino.runtime.opset2.ops import space_to_batch
163
+ from openvino.runtime.opset1.ops import space_to_depth
164
+ from openvino.runtime.opset1.ops import split
165
+ from openvino.runtime.opset1.ops import sqrt
166
+ from openvino.runtime.opset1.ops import squared_difference
167
+ from openvino.runtime.opset1.ops import squeeze
168
+ from openvino.runtime.opset1.ops import strided_slice
169
+ from openvino.runtime.opset1.ops import subtract
170
+ from openvino.runtime.opset4.ops import swish
171
+ from openvino.runtime.opset1.ops import tan
172
+ from openvino.runtime.opset1.ops import tanh
173
+ from openvino.runtime.opset1.ops import tensor_iterator
174
+ from openvino.runtime.opset1.ops import tile
175
+ from openvino.runtime.opset11.ops import topk
176
+ from openvino.runtime.opset1.ops import transpose
177
+ from openvino.runtime.opset10.ops import unique
178
+ from openvino.runtime.opset1.ops import unsqueeze
179
+ from openvino.runtime.opset1.ops import variadic_split
@@ -0,0 +1,107 @@
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 functools import partial
7
+ from typing import List, Optional
8
+
9
+ from openvino.runtime import Node
10
+ from openvino.runtime.opset_utils import _get_node_factory
11
+ from openvino.runtime.utils.decorators import nameable_op
12
+ from openvino.runtime.utils.types import (
13
+ NodeInput,
14
+ as_nodes,
15
+ )
16
+
17
+ _get_node_factory_opset11 = partial(_get_node_factory, "opset11")
18
+
19
+ # -------------------------------------------- ops ------------------------------------------------
20
+
21
+
22
+ @nameable_op
23
+ def interpolate(
24
+ image: NodeInput,
25
+ scales_or_sizes: NodeInput,
26
+ mode: str,
27
+ shape_calculation_mode: str,
28
+ pads_begin: Optional[List[int]] = None,
29
+ pads_end: Optional[List[int]] = None,
30
+ coordinate_transformation_mode: str = "half_pixel",
31
+ nearest_mode: str = "round_prefer_floor",
32
+ antialias: bool = False,
33
+ cube_coeff: float = -0.75,
34
+ axes: Optional[NodeInput] = None,
35
+ name: Optional[str] = None,
36
+ ) -> Node:
37
+ """Perfors the interpolation of the input tensor.
38
+
39
+ :param image: The node providing input tensor with data for interpolation.
40
+ :param scales_or_sizes:
41
+ 1D tensor providing information used to calculate the output shape
42
+ of the operation. It might contain floats (scales) or integers(sizes).
43
+ :param mode: Specifies type of interpolation. Possible values are: nearest, linear,
44
+ linear_onnx, cubic, bilinear_pillow, bicubic_pillow.
45
+ :param shape_calculation_mode:
46
+ Specifies how the scales_or_sizes input should be interpreted.
47
+ :param pads_begin: Specifies the number of pixels to add to the beginning of the image
48
+ being interpolated. Default is None.
49
+ :param pads_end: Specifies the number of pixels to add to the end of the image being
50
+ interpolated. Default is None.
51
+ :param coordinate_transformation_mode:
52
+ Specifies how to transform the coordinate in the resized tensor to the
53
+ coordinate in the original tensor. Default is "half_pixel".
54
+ :param nearest_mode: Specifies round mode when mode == nearest and is used only when
55
+ mode == nearest. Default is "round_prefer_floor".
56
+ :param antialias: Specifies whether to perform anti-aliasing. Default is False.
57
+ :param cube_coeff: Specifies the parameter a for cubic interpolation. Default is -0.75.
58
+ :param axes: 1D tensor specifying dimension indices where interpolation is applied.
59
+ The default is None.
60
+ :param name: Optional name for the output node. The default is None.
61
+ :return: Node representing the interpolation operation.
62
+ """
63
+ attrs = {
64
+ "mode": mode,
65
+ "shape_calculation_mode": shape_calculation_mode,
66
+ "coordinate_transformation_mode": coordinate_transformation_mode,
67
+ "nearest_mode": nearest_mode,
68
+ "antialias": antialias,
69
+ "cube_coeff": cube_coeff,
70
+ }
71
+
72
+ attrs["pads_begin"] = [] if pads_begin is None else pads_begin
73
+ attrs["pads_end"] = [] if pads_end is None else pads_end
74
+
75
+ inputs = as_nodes(image, scales_or_sizes, name=name) if axes is None else as_nodes(image, scales_or_sizes, axes, name=name)
76
+
77
+ return _get_node_factory_opset11().create("Interpolate", inputs, attrs)
78
+
79
+
80
+ @nameable_op
81
+ def topk(
82
+ data: NodeInput,
83
+ k: NodeInput,
84
+ axis: int,
85
+ mode: str,
86
+ sort: str,
87
+ index_element_type: str = "i32",
88
+ stable: bool = False,
89
+ name: Optional[str] = None,
90
+ ) -> Node:
91
+ """Return a node which performs TopK.
92
+
93
+ :param data: Input data.
94
+ :param k: K.
95
+ :param axis: TopK Axis.
96
+ :param mode: Compute TopK largest ('max') or smallest ('min')
97
+ :param sort: Order of output elements (sort by: 'none', 'index' or 'value')
98
+ :param index_element_type: Type of output tensor with indices.
99
+ :param stable: Specifies whether the equivalent elements should maintain
100
+ their relative order from the input tensor during sorting.
101
+ :return: The new node which performs TopK
102
+ """
103
+ return _get_node_factory_opset11().create(
104
+ "TopK",
105
+ as_nodes(data, k, name=name),
106
+ {"axis": axis, "mode": mode, "sort": sort, "index_element_type": index_element_type, "stable": stable},
107
+ )