Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Py OV] Alias classes and functions in flatten openvino namespace #28085

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

almilosz
Copy link
Contributor

Details:

  • Add imports from _pyopenivno on the top of the __init__.py
  • ...

Tickets:

Signed-off-by: Alicja Miloszewska <[email protected]>
…into almilosz/alias-classes

Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
@almilosz almilosz requested review from a team as code owners December 16, 2024 20:29
@github-actions github-actions bot added category: Python API OpenVINO Python bindings category: tools OpenVINO C++ / Python tools category: OVC OVC tool labels Dec 16, 2024
@almilosz almilosz requested a review from a team as a code owner December 17, 2024 13:39
Signed-off-by: Alicja Miloszewska <[email protected]>
Comment on lines +93 to +110
# Extend Node class to support binary operators
Node.__add__ = opset13.add
Node.__sub__ = opset13.subtract
Node.__mul__ = opset13.multiply
Node.__div__ = opset13.divide
Node.__truediv__ = opset13.divide
Node.__radd__ = lambda left, right: opset13.add(right, left)
Node.__rsub__ = lambda left, right: opset13.subtract(right, left)
Node.__rmul__ = lambda left, right: opset13.multiply(right, left)
Node.__rdiv__ = lambda left, right: opset13.divide(right, left)
Node.__rtruediv__ = lambda left, right: opset13.divide(right, left)
Node.__eq__ = utils.deprecated(version="2025.3", message="Use ops.equal instead")(opset13.equal)
Node.__ne__ = utils.deprecated(version="2025.3", message="Use ops.not_equal instead")(opset13.not_equal)
Node.__lt__ = utils.deprecated(version="2025.3", message="Use ops.less instead")(opset13.less)
Node.__le__ = utils.deprecated(version="2025.3", message="Use ops.less_equal instead")(opset13.less_equal)
Node.__gt__ = utils.deprecated(version="2025.3", message="Use ops.greater instead")(opset13.greater)
Node.__ge__ = utils.deprecated(version="2025.3", message="Use ops.greater_equal instead")(opset13.greater_equal)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need it here. You can extend it in one place and re-use it overall.
Let say in py file for Node class that is more logical to have

Signed-off-by: Alicja Miloszewska <[email protected]>
…into almilosz/alias-classes

Signed-off-by: Alicja Miloszewska <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: OVC OVC tool category: Python API OpenVINO Python bindings category: tools OpenVINO C++ / Python tools do_not_merge do_not_review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants