Skip to content

Commit 3f71eb1

Browse files
almiloszmryzhov
andauthored
[Py OV] Fix openvino.Model documentation (#29789)
### Details: - Port of #29785 ### Tickets: - [CVS-164395](https://jira.devtools.intel.com/browse/CVS-164395) --------- Signed-off-by: Alicja Miloszewska <alicja.miloszewska@intel.com> Co-authored-by: Mikhail Ryzhov <mikhail.ryzhov@intel.com>
1 parent 93a02b0 commit 3f71eb1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bindings/python/src/openvino/_ov_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ class ModelMeta(type):
2828
def __dir__(cls) -> list:
2929
return list(set(cls.__dict__.keys()) | set(dir(ModelBase)))
3030

31+
def __getattribute__(cls, name: str) -> Any:
32+
if name == "__init__":
33+
return getattr(ModelBase, name)
34+
return super().__getattribute__(name)
35+
36+
def __getattr__(cls, name: str) -> Any:
37+
# Return the attribute defined in _pyopenvino.Model if it exists
38+
# otherwise AttributeError will be raised
39+
return getattr(ModelBase, name)
40+
3141

3242
class Model(object, metaclass=ModelMeta):
3343
def __init__(self, *args: Any, **kwargs: Any) -> None:

0 commit comments

Comments
 (0)