|
3 | 3 | # SPDX-License-Identifier: Apache-2.0
|
4 | 4 |
|
5 | 5 | from types import TracebackType
|
6 |
| -from typing import Any, Iterable, Union, Optional, Dict, Tuple, Type, List |
| 6 | +from typing import Any, Iterable, Union, Optional, Dict, Tuple, List |
| 7 | +from typing import Type as TypingType |
7 | 8 | from pathlib import Path
|
8 | 9 |
|
9 | 10 |
|
|
12 | 13 | from openvino._pyopenvino import CompiledModel as CompiledModelBase
|
13 | 14 | from openvino._pyopenvino import AsyncInferQueue as AsyncInferQueueBase
|
14 | 15 | from openvino._pyopenvino import Op as OpBase
|
15 |
| -from openvino._pyopenvino import Node, Output, Tensor |
| 16 | +from openvino._pyopenvino import Node, Output, Tensor, Type |
16 | 17 |
|
17 | 18 | from openvino.utils.data_helpers import (
|
18 | 19 | OVDict,
|
19 | 20 | _InferRequestWrapper,
|
20 | 21 | _data_dispatch,
|
21 | 22 | tensor_from_file,
|
22 | 23 | )
|
| 24 | +from openvino.package_utils import deprecatedclassproperty |
23 | 25 |
|
24 | 26 |
|
25 | 27 | class Op(OpBase):
|
@@ -76,7 +78,7 @@ def __deepcopy__(self, memo: Dict) -> "Model":
|
76 | 78 | def __enter__(self) -> "Model":
|
77 | 79 | return self
|
78 | 80 |
|
79 |
| - def __exit__(self, exc_type: Type[BaseException], exc_value: BaseException, traceback: TracebackType) -> None: |
| 81 | + def __exit__(self, exc_type: TypingType[BaseException], exc_value: BaseException, traceback: TracebackType) -> None: |
80 | 82 | del self.__model
|
81 | 83 | self.__model = None
|
82 | 84 |
|
@@ -695,3 +697,16 @@ def compile_model(
|
695 | 697 | if isinstance(model, Model):
|
696 | 698 | model = model._Model__model
|
697 | 699 | return core.compile_model(model, device_name, {} if config is None else config)
|
| 700 | + |
| 701 | + |
| 702 | +@deprecatedclassproperty( |
| 703 | + name="openvino.Type.undefined", # noqa: N802, N805 |
| 704 | + version="2026.0", |
| 705 | + message="Please use openvino.Type.dynamic instead.", |
| 706 | + stacklevel=2, |
| 707 | +) |
| 708 | +def undefined_deprecated(self): # type: ignore |
| 709 | + return Type.dynamic |
| 710 | + |
| 711 | + |
| 712 | +Type.undefined = undefined_deprecated |
0 commit comments