openvino icon indicating copy to clipboard operation
openvino copied to clipboard

[Good First Issue][PyOV]: Support direct comparison of PartialShape and Shape with list and tuple

Open jiwaszki opened this issue 1 year ago • 16 comments

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__ for PartialShape and Shape classes 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

Contact points

@jiwaszki @akuporos @p-wysocki

Ticket

128813

jiwaszki avatar Jan 04 '24 16:01 jiwaszki

I am working on this.

EJ-enun avatar Jan 05 '24 17:01 EJ-enun

can this issue be assigned to me?

EJ-enun avatar Jan 05 '24 17:01 EJ-enun

Hi

I am working on this. @jiwaszki , @adk9 , @tpwrules , @EJ-enun

Can I submit the PR?

Lymah123 avatar Jan 06 '24 10:01 Lymah123

Hi @rafalxintel, I don't seem to see the file I will make modifications in.

Lymah123 avatar Jan 07 '24 06:01 Lymah123

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.

p-wysocki avatar Jan 08 '24 12:01 p-wysocki

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.

Lymah123 avatar Jan 08 '24 12:01 Lymah123

Hi @EJ-enun, are you still working on this?

p-wysocki avatar Jan 19 '24 14:01 p-wysocki

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: @.***>

EJ-enun avatar Jan 19 '24 14:01 EJ-enun

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. :)

p-wysocki avatar Jan 19 '24 15:01 p-wysocki

I am in the discord and it is completely alright!

EJ-enun avatar Jan 20 '24 12:01 EJ-enun

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?

Saharshjain78 avatar Jun 18 '24 22:06 Saharshjain78

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

github-actions[bot] avatar Jun 18 '24 22:06 github-actions[bot]

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.

akuporos avatar Jun 19 '24 07:06 akuporos

@mlukasze and @akuporos here is the pull request to solve this issue- https://github.com/openvinotoolkit/openvino/pull/25137

Saharshjain78 avatar Jun 20 '24 17:06 Saharshjain78

.take

hub-bla avatar Aug 27 '24 15:08 hub-bla

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

github-actions[bot] avatar Aug 27 '24 15:08 github-actions[bot]