You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We do not formally support plotting from pytorch. Despite that, I suggested a fix in #26807 that solves the problem, although I am not sure it will be merged.
This does not change functionality. The code path for
`safe_first_element` is `_safe_first_finite(skip_nonfinite=False)` which
is separate code block and does not interact with the
skip_nonfinite=True case. IMHO this is more readable.
Also add a comment on the exception handling recently modified in matplotlib#26806.
Bug summary
Value error occurs when trying to plot a 2D pytorch tensor using
matplotlib==3.8.0
. The error does not arise inmatplotlib==3.7.3
.Code for reproduction
Actual outcome
(included REPL output in above example)
Expected outcome
Expect 5 line series (one for each of the second dimension of the tensor)
Additional information
The bug seems to occur in version 3.8.0. (In both cases I was using
torch==2.0.1
)Operating system
Ubuntu
Matplotlib Version
3.8.0 and 3.7.3
Matplotlib Backend
TkAgg
Python version
Python 3.11.5
Jupyter version
N/A
Installation
pip
The text was updated successfully, but these errors were encountered: