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

rr.Tensor not working for 1D tensors #3709

Closed
roym899 opened this issue Oct 5, 2023 · 1 comment · Fixed by #3769
Closed

rr.Tensor not working for 1D tensors #3709

roym899 opened this issue Oct 5, 2023 · 1 comment · Fixed by #3769
Assignees
Labels
🪳 bug Something isn't working
Milestone

Comments

@roym899
Copy link
Collaborator

roym899 commented Oct 5, 2023

Describe the bug
When logging a 1D tensor I'm getting "Expected a 2D slice" in the viewer. Before, this would give a bar chart-like plot.

To Reproduce

import rerun as rr
import torch
rr.init("tensor", spawn=True)
rr.log("tensor", rr.Tensor(torch.rand(10,)))

Expected behavior
Previous behavior seems better.

Rerun version

rerun_py 0.9.0 [rustc 1.72.1 (d5c2e9c34 2023-09-13), LLVM 16.0.5] x86_64-unknown-linux-gnu 4f56b02, built 2023-10-05T15:37:48Z
@roym899 roym899 added 🪳 bug Something isn't working 👀 needs triage This issue needs to be triaged by the Rerun team labels Oct 5, 2023
@jleibs jleibs removed the 👀 needs triage This issue needs to be triaged by the Rerun team label Oct 5, 2023
@jleibs jleibs added this to the 0.9.1 milestone Oct 5, 2023
@teh-cmc teh-cmc self-assigned this Oct 10, 2023
@teh-cmc
Copy link
Member

teh-cmc commented Oct 10, 2023

If we don't want to tackle the full story (#3342) for 0.9.1 (and we don't), then I guess the short term fix is simply to relax the bar-chart view's requirements, and strengthen the tensor view's requirements:

  • make bar-chart look for either BarChartIndicator or TensorIndicator
  • make tensor ignore anything with less than 2 dimensions (it can't display those anyway!)

teh-cmc added a commit that referenced this issue Oct 10, 2023
Relax the bar-chart view's requirements, and strengthen the tensor
view's requirements:
- make bar-chart look for either `BarChartIndicator` _or_
`TensorIndicator`
- make tensor ignore anything with less than 2 dimensions (it can't
display those anyway!)

---

```py
import rerun as rr
import torch
rr.init("tensor", spawn=True)
rr.log("tensor", rr.Tensor(torch.rand(10,)))
```

![image](https://github.com/rerun-io/rerun/assets/2910679/1e1e0a7a-9ded-46e1-861f-5d2197fff07d)


---

- Resolves #3709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants