-
Notifications
You must be signed in to change notification settings - Fork 858
Open
Description
Describe the bug
Why is scalar turned into a 1d np array here:
tensorboardX/tensorboardX/x2num.py
Lines 22 to 23 in ca5072b
| if np.isscalar(x): | |
| return check_nan(np.array([x])) |
instead of just np.array(x)?
This result in warning messages like:
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
in the summary.py when converting back to float.
Minimal runnable code to reproduce the behavior
from tensorboardX import SummaryWriter
...
Expected behavior
Proper type conversion.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
What is the result of
pip list|grep -E "torch|proto|tensor"
If the version is too old, please try to update first.
Python environment
Which version of python are you using? Did you use Andconda or Virtualenv?
Additional context
Add any other context about the problem here.
Copilot
Metadata
Metadata
Assignees
Labels
No labels