[Good First Issue][PyOV]: Support direct comparison of PartialShape and Shape with list and tuple
Context
This change will align the behavior of container-like OpenVINO structure to feel more pythonic.
What needs to be done?
- Edit existing or add overloads of
__eq__forPartialShapeandShapeclasses to directly compare with tuple and list. - Add various testcases to verify changes.
- [optional] Refactor already existing tests to use new feature.
Example code that should be passing:
from openvino import Shape, PartialShape
a = [1, 2, 3]
s = Shape(a)
assert a == s
t = (1, 2, 3)
ps = PartialShape(t)
assert t == ps
Example Pull Requests
N/A
Resources
- Contribution guide - start here!
- Intel DevHub Discord channel - engage in discussions, ask questions and talk to OpenVINO developers
Contact points
@jiwaszki @akuporos @p-wysocki
Ticket
128813
I am working on this.
can this issue be assigned to me?
Hi
I am working on this. @jiwaszki , @adk9 , @tpwrules , @EJ-enun
Can I submit the PR?
Hi @rafalxintel, I don't seem to see the file I will make modifications in.
Hello @Lymah123, we're following the policy of whoever picks the issue first, is the issue owner. The task remains in the hands of @EJ-enun, if you wish to collaborate on this you should ask them.
Hello @Lymah123, we're following the policy of whoever picks the issue first, is the issue owner. The task remains in the hands of @EJ-enun, if you wish to collaborate on this you should ask them.
Okay.
Hi @EJ-enun, are you still working on this?
Yes I am working on this but I am having issues identifying the requisite files in the repository to make the changes requested. I have been stumped on this for a few days now and I am just a little confused and embarrassed to say that on the thread. If you could point me towards them that would be great.
On Fri, 19 Jan 2024 at 09:19, Przemyslaw Wysocki @.***> wrote:
Hi @EJ-enun https://github.com/EJ-enun, are you still working on this?
— Reply to this email directly, view it on GitHub https://github.com/openvinotoolkit/openvino/issues/21969#issuecomment-1900504404, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQIIERQWQ3ENLHXF2D2BDM3YPJ6FVAVCNFSM6AAAAABBNFWXDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBQGUYDINBQGQ . You are receiving this because you were mentioned.Message ID: @.***>
Don't worry, we're here to help. The changes need to be made to:
Shape: openvino/src/bindings/python/src/pyopenvino/graph/shape.cpp
PartialShape: openvino/src/bindings/python/src/pyopenvino/graph/partial_shape.cpp.
You're also welcome to join Intel DevHub Discord, it's sometimes easier to ask questions on the chat. Sorry if you're already there, there's a lot of names. :)
I am in the discord and it is completely alright!
Hey @akuporos , I followed the chat and am interested in solving and .take this issue , can you please assign this issue to me and a quick recap of what needs to be done to be more efficient pr?
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
Hello @Saharshjain78,
Thank you for your interest in the development of OpenVINO!
It's need to edit existing/add overloads of _eq_ for PartialShape and Shape classes to directly compare with tuple and list.
Also, please, add tests to this file to cover this feature. Here you may find the document How to test OpenVINO Python API.
The example of how it should work you may find in the description of this issue.
@mlukasze and @akuporos here is the pull request to solve this issue- https://github.com/openvinotoolkit/openvino/pull/25137
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.