-
Notifications
You must be signed in to change notification settings - Fork 22
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
Print dpnp array #1279
Print dpnp array #1279
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests to test-suite that exercise array printing functionality.
5040914
to
d74d96a
Compare
result = str(dpnp.array([[1, 2], [3, 4]])) | ||
expected = "[[1 2]\n [3 4]]" | ||
assert(result==expected) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably to add also a test case with ...
in the string output.
@vtavana Could you please install/build dpctl from sources of IntelPython/dpctl#1060 and change your def __repr__(self):
return dpt.usm_ndarray_repr(self._array_obj, prefix="ndarray") Adjust the @antonwolfy, @samaid, @npolina4 Should we choose |
d74d96a
to
67d5cb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thank you @vtavana
Adding string representation of the array object using
__str__
and__repr__