Skip to content

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

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

sys-openvino-cia5cad9aefaad
diff --git a/src/bindings/python/src/openvino/_pyopenvino/__init__.pyi b/src/bindings/python/src/openvino/_pyopenvino/__init__.pyi
index 8c74507e996..d9809570a80 100644
--- a/src/bindings/python/src/openvino/_pyopenvino/__init__.pyi
+++ b/src/bindings/python/src/openvino/_pyopenvino/__init__.pyi
@@ -4856,7 +4856,7 @@ class Tensor:
Returns numpy array with corresponding shape and dtype.
- For tensors with OpenVINO specific element type, such as u1, u4 or i4
+ For tensors with OpenVINO specific element type, such as u1, u2, u4 or i4
it returns linear array, with uint8 / int8 numpy dtype.
For tensors with string element type, returns a numpy array of bytes
@@ -5012,6 +5012,7 @@ class Type:
string: typing.ClassVar[Type] # value = <Type: 'string'>
u1: typing.ClassVar[Type] # value = <Type: 'uint1_t'>
u16: typing.ClassVar[Type] # value = <Type: 'uint16_t'>
+ u2: typing.ClassVar[Type] # value = <Type: 'uint2_t'>
u32: typing.ClassVar[Type] # value = <Type: 'uint32_t'>
u4: typing.ClassVar[Type] # value = <Type: 'uint4_t'>
u64: typing.ClassVar[Type] # value = <Type: 'uint64_t'>
diff --git a/src/bindings/python/src/openvino/_pyopenvino/passes.pyi b/src/bindings/python/src/openvino/_pyopenvino/passes.pyi
index f8d6c72773b..12710f5a65f 100644
--- a/src/bindings/python/src/openvino/_pyopenvino/passes.pyi
+++ b/src/bindings/python/src/openvino/_pyopenvino/passes.pyi
@@ -105,8 +105,8 @@ class LowLatency2(ModelPass, PassBase):
"""
Create LowLatency2 pass which is used for changing the structure of the model,
which contains TensorIterator/Loop operations.
- The transformation finds all TensorIterator/Loop layers in the network,
- processes all back edges that describe a connection between Result and Parameter of the TensorIterator/Loop bodies,
+ The transformation finds all TensorIterator/Loop layers in the network,
+ processes all back edges that describe a connection between Result and Parameter of the TensorIterator/Loop bodies,
and inserts ReadValue and Assign layers at the input and output corresponding to this back edge.
:param use_const_initializer: Changes the type of the initializing subgraph for ReadValue operations.
@@ -124,7 +124,7 @@ class MakeStateful(ModelPass, PassBase):
def __init__(self, pairs_to_replace: collections.abc.Sequence[tuple[openvino._pyopenvino.op.Parameter, openvino._pyopenvino.op.Result]]) -> None:
"""
The transformation replaces the provided pairs Parameter and Result with openvino Memory operations ReadValue and Assign.
-
+
:param pairs_to_replace:
:type pairs_to_replace: list[tuple[op.Parameter, op.Result]
"""
@@ -132,7 +132,7 @@ class MakeStateful(ModelPass, PassBase):
def __init__(self, pairs_to_replace: collections.abc.Mapping[str, str]) -> None:
"""
The transformation replaces the provided pairs Parameter and Result with openvino Memory operations ReadValue and Assign.
-
+
:param pairs_to_replace: a dictionary of names of the provided Parameter and Result operations.
:type pairs_to_replace: dict[str, str]
"""
@@ -717,18 +717,18 @@ class VisualizeTree(ModelPass, PassBase):
"""
openvino.passes.VisualizeTree transformation
"""
- def __init__(self, file_name: str, nm: collections.abc.Callable[[openvino._pyopenvino.Node, collections.abc.Sequence[str]], None] = None, don_only: bool = False) -> None:
+ def __init__(self, file_name: typing.Any, nm: collections.abc.Callable[[openvino._pyopenvino.Node, collections.abc.Sequence[str]], None] = None, dot_only: bool = False) -> None:
"""
Create VisualizeTree pass which is used for Model to dot serialization.
:param file_name: Path where serialized model will be saved. For example: /tmp/out.svg
- :type file_name: str
+ :type file_name: Union[str, bytes, pathlib.Path]
:param nm: Node modifier function.
:type nm: function
- :param don_only: Enable only dot file generation.
- :type don_only: bool
+ :param dot_only: Enable only dot file generation.
+ :type dot_only: bool
"""
def __repr__(self) -> str:
...
diff --git a/src/bindings/python/src/openvino/helpers/packing.pyi b/src/bindings/python/src/openvino/helpers/packing.pyi
index a23d3f7daab..829c95cabc1 100644
--- a/src/bindings/python/src/openvino/helpers/packing.pyi
+++ b/src/bindings/python/src/openvino/helpers/packing.pyi
@@ -8,7 +8,7 @@ import openvino._pyopenvino
__all__: list[str] = ['Shape', 'Type', 'np', 'pack_data', 'unpack_data']
def pack_data(array: numpy.ndarray, type: openvino._pyopenvino.Type) -> numpy.ndarray:
"""
- Represent array values as u1,u4 or i4 openvino element type and pack them into uint8 numpy array.
+ Represent array values as u1, u2, u4 or i4 openvino element type and pack them into uint8 numpy array.
If the number of elements in array is odd we pad them with zero value to be able to fit the bit
sequence into the uint8 array.
@@ -19,7 +19,7 @@ def pack_data(array: numpy.ndarray, type: openvino._pyopenvino.Type) -> numpy.nd
:param array: numpy array with values to pack.
:type array: numpy array
- :param type: Type to interpret the array values. Type must be u1, u4, i4, nf4 or f4e2m1.
+ :param type: Type to interpret the array values. Type must be u1, u2, u4, i4, nf4 or f4e2m1.
:type type: openvino.Type
"""
@@ -33,7 +33,7 @@ def unpack_data(array: numpy.ndarray, type: openvino._pyopenvino.Type, shape: ty
:param array: numpy array to unpack.
:type array: numpy array
- :param type: Type to extract from array values. Type must be u1, u4, i4, nf4 or f4e2m1.
+ :param type: Type to extract from array values. Type must be u1, u2, u4, i4, nf4 or f4e2m1.
:type type: openvino.Type
:param shape: the new shape for the unpacked array.
:type shape: Union[list, openvino.Shape]