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

Support displaying 1D tensors #5837

Merged
merged 6 commits into from Apr 8, 2024
Merged

Support displaying 1D tensors #5837

merged 6 commits into from Apr 8, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Apr 8, 2024

What

Technically two separate fixes:

  • visualizability for 1 x n and n x 1 was blocked
  • real single dimension tensors are now supported

Test code:

import rerun as rr
import numpy as np

rr.init("1dtensor", spawn=True)
x = np.linspace(0.0, 100.0, 100)
rr.log("n", rr.Tensor(x))
rr.log("n_x_1", rr.Tensor(np.reshape(x, (100, 1))))
rr.log("1_x_n", rr.Tensor(np.reshape(x, (1, 100))))

Before:
Screenshot 2024-04-08 at 10 00 40
After first commit:
Screenshot 2024-04-08 at 10 02 53

After second commit:

Screen.Recording.2024-04-08.at.11.07.18.mov

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

@Wumpf Wumpf added 🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself labels Apr 8, 2024
@Wumpf Wumpf changed the title Fix not displaying 1D tensors Support displaying 1D tensors Apr 8, 2024
@emilk
Copy link
Member

emilk commented Apr 8, 2024

1D tensors used to be visualized as bar charts - what happens to the heuristic around that now?

See e.g. docs/snippets/all/bar_chart.py

@Wumpf
Copy link
Member Author

Wumpf commented Apr 8, 2024

1D tensors used to be visualized as bar charts - what happens to the heuristic around that now?

not entirely true ever since we introduced indicators. You have to have a bar chart indicator in order to be picked up as a bar chart automatically
But let me run testing on bar charts and check if one can create a bar chat space view for those tensors in the test script!

@nikolausWest
Copy link
Member

@Wumpf Wumpf linked an issue Apr 8, 2024 that may be closed by this pull request
Copy link
Member

@jleibs jleibs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked through and tested this a bit and it makes sense. @Wumpf is still fixing 1 edge case with creating bar chart from an existing tensor.

@Wumpf
Copy link
Member Author

Wumpf commented Apr 8, 2024

Hit this very related bug, but not going to address it here or for the release in general:

@Wumpf Wumpf changed the base branch from release-0.15 to release-0.15.0 April 8, 2024 13:25
@Wumpf Wumpf merged commit d7a672e into release-0.15.0 Apr 8, 2024
36 checks passed
@Wumpf Wumpf deleted the andreas/tensor-1d-fix branch April 8, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working include in changelog 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1xN tensors are not visualizable
4 participants