openvino
openvino copied to clipboard
Python binding for the `Shape` and `PartialShape` classes added with …
…the relevant tests.
Python binding for the Shape
or PartialShape
classes added with corresponding tests in the OpenVINO library.This allows Python code to create and manipulate instances of the Shape
or PartialShape
class.
The __eq__
method is a special method in Python that defines the behavior of the equality operator ==
. In the original code, this method is not defined for the Shape
and PartialShape
class, which means that by default, two Shape
or PartialShape
objects are considered equal if they are the same object. However, it does not allow for comparison with Python native data types like lists and tuples, which is what the new requirement is asking for.
To implement this, I added two new overloads of the __eq__
method. One overload takes a py::tuple
as the second argument, and the other takes a py::list
. Both methods in each script first check if the size of the Shape
or PartialShape
object is the same as the size of the tuple or list. If the sizes are not the same, the two objects cannot be equal, so the method returns false
. If the sizes are the same, the method then compares each element of the Shape
and PartialShape
objects with the corresponding element of the tuple or list. If it finds any pair of elements that are not equal, it returns false
. If it gets through all the elements without finding any unequal pairs, it returns true
.
The test cases are straightforward. They create Shape
and PartialShape
objects from lists and tuples, and then use the assert
statement to check that the Shape
and PartialShape
objects are equal to the original list or tuple. If the __eq__
method is implemented correctly, these assertions will pass.
Details:
- item1
- ...
Tickets:
Closes https://github.com/openvinotoolkit/openvino/issues/21969
build_jenkins
Hello @EJ-enun,
Thank you for your contribution.
Please, fix codestyle for cpp files and apply changes according to the comments left.
The easiest way to fix codestyle is -- configure project like this
cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -B build
This command will create codestyle diff, just apply it.
cmake --build build --target clang_format_fix_all -j8
build_jenkins
This PR will be closed in a week because of 2 weeks of no activity.
hej @EJ-enun, hope you are well :) Will you find a time to address comments and finish PR?
This PR will be closed in a week because of 2 weeks of no activity.
Hi, been swamped with work. Will get on it this weekend.
hej @EJ-enun, hope you are well :)
Will you find a time to address comments and finish PR?
Hi, i will devote time to this tomorrow. I've had a torrid 2 weeks.
hey @EJ-enun :) will you have time to address Anastasia's requests?
Yes, I will. Which specific concerns perchance?
On Tue, 19 Mar 2024 at 05:02, Michal Lukaszewski @.***> wrote:
hey @EJ-enun https://github.com/EJ-enun :) will you have time to address Anastasia's requests?
— Reply to this email directly, view it on GitHub https://github.com/openvinotoolkit/openvino/pull/22316#issuecomment-2006397936, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQIIERSFXBN6VOPTFJEFCGLYY75LDAVCNFSM6AAAAABCFIDINKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBWGM4TOOJTGY . You are receiving this because you were mentioned.Message ID: @.***>
This PR will be closed in a week because of 2 weeks of no activity.
Hi @EJ-enun,
Could you please u[date your PR? Remove excess files like CMakeCache and fix codestyle according to my comments.
Thank you, Anastasia
Hi @akuporos , I ran the Cmake command and fixed the codestyle for cpp files and applied the other changes according to the comments left. I deleted the Cmake cache quite a while ago, can you please help me check and make sure i am on track? I would like to complete this as I have let it drag on for too long. Thank you, Enun
Hi @EJ-enun,
I still see CMakeCache.txt
in File Changed. Looks like it was missed.
Also I see that my comments weren't applied -- I don't see codestyle changes in the test file.
Everytime i try to run this script "cmake --build build --target clang_format_fix_all -j8"
I get the ninja: error: unknown target 'clang_format_fix_all' I have checked the CMakeLists.txt file and i cannot find 'clang_format_fix_all' in there. How do i resolve this?
HI @EJ-enun,
Have you installed clang-format-9
?
Did you configured project like this cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT ..
?
cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -B build
I ran this command successfully "cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -B build" but the other command returns that error. And how do I install clang-format-9 outside of this command.
@EJ-enun
Please, check this instruction.
About clang-format-9
-- it had to be installed before running cmake commands.
sudo apt --assume-yes install clang-format-9
. But looks like it is installed because otherwise I think you would have problem on the first command.
Actually, for right now you may skip this step with fixing codestyle for .cpp files. Please, remove CMakeCache.txt and apply my comments above (they're fixing codestyle for python files).
This PR will be closed in a week because of 2 weeks of no activity.
hey @EJ-enun will you find a time to finish this PR?
hey @EJ-enun will you find a time to finish this PR?
Yes i Will.
This PR will be closed in a week because of 2 weeks of no activity.
This PR was closed because it has been stalled for 2 week with no activity.