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
Crash when calling Tensor::nonzero() on a tensor that all values are zero. Is this a bug or is the behavior intentional? (because of zero size tensor). To Reproduce
use burn::{
backend::wgpu::Wgpu,
tensor::{backend::Backend,Tensor},};typeMyBackend= Wgpu;fnmain(){let device = Default::default();let bools = Tensor::<MyBackend,1>::zeros([1000],&device).bool();// let bools = Tensor::<MyBackend, 1>::full([1000],0.0, &device).bool();let non_zero_indices = Tensor::nonzero(bools);// panics ... we need to use Tensor::any() before calling this function.}
Expected behavior
Should return a vector of zero size tensors or a vector of Option.
The text was updated successfully, but these errors were encountered:
Describe the bug
Crash when calling Tensor::nonzero() on a tensor that all values are zero. Is this a bug or is the behavior intentional? (because of zero size tensor).
To Reproduce
Expected behavior
Should return a vector of zero size tensors or a vector of Option.
The text was updated successfully, but these errors were encountered: