Unit Testing for MyTensor Object Creation in OpenVINO
Pull Request Description
This pull request introduces the ability to directly compare PartialShape and Shape objects with lists and tuples. This enhancement simplifies the process of comparing shapes and dimensions in OpenVINO.
Changes
Shape Class
-
Added equality operators in the
Shapeclass to support comparison withstd::list<size_t>andstd::tuple<size_t>. This allows for direct comparison of aShapeobject with a list or tuple of dimensions. -
Implemented the
operator[]andat()methods in theShapeclass to support accessing elements by index. The index is normalized to handle negative indices, similar to Python's indexing. -
Overloaded the
<<operator forov::Shapeto support printingShapeobjects.
PartialShape Class
-
Added equality operators in the
PartialShapeclass to support comparison withstd::list<Dimension::value_type>andstd::tuple<Dimension::value_type>. This allows for direct comparison of aPartialShapeobject with a list or tuple of dimensions. -
Implemented the
operator==method inov::PartialShapeto support comparison of twoPartialShapeobjects.
Unit Tests
- Added unit tests for the creation, value retrieval, shape checking, and dtype checking of
MyTensorobjects.
These changes aim to improve the usability of the OpenVINO library by simplifying the comparison of shapes and dimensions.