Skip to content

Updating repr() function #2067

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

Merged
merged 4 commits into from
May 3, 2025
Merged

Updating repr() function #2067

merged 4 commits into from
May 3, 2025

Conversation

vtavana
Copy link
Collaborator

@vtavana vtavana commented Apr 29, 2025

Updating repr() to show that shape of the array for abbreviated arrays and shape and dtype of arrays for zero-size arrays
With this change, we will have

import dpctl.tensor as dpt
a = dpt.ones(1001)
a
# usm_ndarray([1., 1., 1., ..., 1., 1., 1.], shape=(1001,))

b = dpt.ones((10, 0))
b
# usm_ndarray([], shape=(10, 0), dtype=float64)
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@vtavana vtavana self-assigned this Apr 29, 2025
Copy link

github-actions bot commented Apr 29, 2025

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_173 ran successfully.
Passed: 1108
Failed: 4
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Apr 29, 2025

Coverage Status

coverage: 86.372% (-0.05%) from 86.419%
when pulling 05c8923 on update-print
into b7a6b67 on master.

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_174 ran successfully.
Passed: 1108
Failed: 4
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_175 ran successfully.
Passed: 1109
Failed: 3
Skipped: 119

@vtavana vtavana marked this pull request as ready for review April 30, 2025 03:41
@ndgrigorian
Copy link
Collaborator

Aside from that change LGTM!

Copy link

github-actions bot commented May 3, 2025

Array API standard conformance tests for dpctl=0.20.0dev0=py310h93fe807_187 ran successfully.
Passed: 1110
Failed: 2
Skipped: 119

@vtavana vtavana merged commit 544cd87 into master May 3, 2025
71 of 72 checks passed
@vtavana vtavana deleted the update-print branch May 3, 2025 13:19
vtavana added a commit to IntelPython/dpnp that referenced this pull request May 5, 2025
The behavior of `repr` was modified in
IntelPython/dpctl#2067.

Tests in `dpnp` should be modified to align with this new behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants