Skip to content

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

[PyOV] Add `__slots__` to `OVDict` (#37253)

Przemyslaw Wysockic4e7e0288fab
diff --git a/src/bindings/python/src/openvino/utils/data_helpers/wrappers.py b/src/bindings/python/src/openvino/utils/data_helpers/wrappers.py
index 686d1879eb9..e68ca8b6fa7 100644
--- a/src/bindings/python/src/openvino/utils/data_helpers/wrappers.py
+++ b/src/bindings/python/src/openvino/utils/data_helpers/wrappers.py
@@ -66,6 +66,8 @@ class OVDict(Mapping):
# or alternatively:
out1, out2, out3, _ = request.infer(inputs).to_tuple()
"""
+ __slots__ = ("_dict", "_names", "__weakref__")
+
def __init__(self, _dict: dict[ConstOutput, np.ndarray]) -> None:
self._dict = _dict
self._names: Optional[dict[ConstOutput, set[str]]] = None