Skip to content
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

Fix printing tensor bug - regression introduced in #6444 #6595

Merged

Conversation

saurabheights
Copy link
Contributor

Type

Motivation and Context

My apologies for adding the regression in printing of cuda tensor. I recently got the cuda build working, thus detected this regression late. I have tested the bug.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

The earlier PR #6444 added a bug where suffix for cuda tensor is printed when it is moved to CPU and then again when it is in GPU.

o3d.core.Tensor.eye(n=4, dtype=o3d.core.Dtype.Float64, device=o3d.core.Device('cuda:0'))
[[1 0 0 0],
 [0 1 0 0],
 [0 0 1 0],
 [0 0 0 1]]
Tensor[shape={4, 4}, stride={4, 1}, Float64, CPU:0, 0x561c38e195d0]
Tensor[shape={4, 4}, stride={4, 1}, Float64, CUDA:0, 0x302000000]

This is fixed with test below.
Screenshot from 2024-01-11 12-55-02

Again, my apologies. This being added to v0.18 just makes it worse.

@saurabheights saurabheights changed the title Fix regression introduced in #6444 Fix printing tensor bug - regression introduced in #6444 Jan 11, 2024
@ssheorey
Copy link
Member

ssheorey commented Jan 19, 2024

Thanks @saurabheights !
CI failure is unrelated to PR.

@ssheorey ssheorey merged commit ee65b6c into isl-org:main Jan 19, 2024
35 of 36 checks passed
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