Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[PyOV] Update Python API stub files (#32537)

sys-openvino-ci4a0412dec29d
diff --git a/src/bindings/python/src/openvino/opset16/__init__.pyi b/src/bindings/python/src/openvino/opset16/__init__.pyi
index e2b1c845e86..0ff787d6d5c 100644
--- a/src/bindings/python/src/openvino/opset16/__init__.pyi
+++ b/src/bindings/python/src/openvino/opset16/__init__.pyi
@@ -1,8 +1,10 @@
# type: ignore
from . import ops
from __future__ import annotations
+from openvino.opset16.ops import avg_pool
from openvino.opset16.ops import identity
from openvino.opset16.ops import istft
+from openvino.opset16.ops import one_hot
from openvino.opset16.ops import segment_max
from openvino.opset16.ops import sparse_fill_empty_rows
-__all__: list[str] = ['identity', 'istft', 'ops', 'segment_max', 'sparse_fill_empty_rows']
+__all__: list[str] = ['avg_pool', 'identity', 'istft', 'one_hot', 'ops', 'segment_max', 'sparse_fill_empty_rows']
diff --git a/src/bindings/python/src/openvino/opset16/ops.pyi b/src/bindings/python/src/openvino/opset16/ops.pyi
index 94668608d14..e9dd9da34cc 100644
--- a/src/bindings/python/src/openvino/opset16/ops.pyi
+++ b/src/bindings/python/src/openvino/opset16/ops.pyi
@@ -1,9 +1,11 @@
# type: ignore
from __future__ import annotations
+from builtins import list as TensorShape
from functools import partial
from openvino._pyopenvino import Node
from openvino.utils.decorators import nameable_op
from openvino.utils.node_factory import _get_node_factory
+from openvino.utils.types import as_node
from openvino.utils.types import as_nodes
import functools
import openvino._pyopenvino
@@ -11,7 +13,28 @@ import typing
"""
Factory functions for ops added to openvino opset16.
"""
-__all__: list[str] = ['Node', 'NodeInput', 'as_nodes', 'identity', 'istft', 'nameable_op', 'partial', 'segment_max', 'sparse_fill_empty_rows']
+__all__: list[str] = ['Node', 'NodeInput', 'TensorShape', 'as_node', 'as_nodes', 'avg_pool', 'identity', 'istft', 'nameable_op', 'one_hot', 'partial', 'segment_max', 'sparse_fill_empty_rows']
+def avg_pool(*args, **kwargs) -> openvino._pyopenvino.Node:
+ """
+ Return average pooling node.
+
+ :param data_batch: The input node providing data.
+ :param strides: The window movement strides.
+ :param pads_begin: The number of pixels to add at the beginning along each axis.
+ :param pads_end: The number of pixels to add at the end along each axis.
+ :param kernel_shape: The pooling window shape.
+ :param exclude_pad: Whether or not to include zero padding in average computations.
+ :param rounding_type: Determines used rounding schema when computing output shape. Acceptable
+ values are: ['floor', 'ceil', 'ceil_torch']. Defaults to 'floor'.
+ :param auto_pad: Determines how the padding is calculated. Acceptable values:
+ [None, 'same_upper', 'same_lower', 'valid']. Defaults to None.
+ :param dilations: The index of the next pixel to select when pooling. If not provided,
+ defaults to [1, 1, ...] (no dilation).
+ :param name: Optional name for the new output node.
+
+ :return: New node with AvgPool operation applied on its data.
+
+ """
def identity(*args, **kwargs) -> openvino._pyopenvino.Node:
"""
Identity operation is used as a placeholder. It creates a copy of the input to forward to the output.
@@ -35,6 +58,26 @@ def istft(*args, **kwargs) -> openvino._pyopenvino.Node:
:param name: The optional name for the created output node.
:return: The new node performing ISTFT operation.
+ """
+def one_hot(*args, **kwargs) -> openvino._pyopenvino.Node:
+ """
+ Create node performing one-hot encoding on input data.
+
+ :param indices: Input tensor of rank N with indices of any supported integer data type.
+ :param depth: Scalar of any supported integer type that specifies number of classes and
+ the size of one-hot dimension.
+ :param on_value: Scalar of any type that is the value that the locations
+ in output tensor represented by indices in input take.
+ :param off_value: Scalar of any type that is the value that the locations not represented
+ by indices in input take.
+ :param axis: New axis position in the output shape to fill with one-hot values.
+ :param negative_indices_mode: Controls how negative indices are handled. Can be 'ignore_negative'
+ (negative indices are ignored and filled with off_value) or
+ 'normalize' (negative indices in range [-depth, -1] are normalized).
+ If not provided, defaults to 'ignore_negative'.
+ :param name: The optional name for new output node.
+ :return: New node performing one-hot operation.
+
"""
def segment_max(*args, **kwargs) -> openvino._pyopenvino.Node:
"""