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
I am adding two new tensor methods related to NaN (is_nan and contains_nan). My unit tests are failing for burn-wgpu backend. See #2088 PR
Describe the bug
These two methods do not work as expected:
/// Returns a new tensor with boolean elements indicating whether each element of the input is NaN.////// # Returns////// A boolean tensor where `true` indicates NaN and `false` indicates a non-NaN value.pubfnis_nan(&self) -> Tensor<B,D,Bool>{// Check if the input tensor is NaN by comparing it to itself// NaN is the only value that is not equal to itselfK::not_equal(self.primitive.clone(),self.primitive.clone())}/// Checks if the tensor contains any NaN values.////// # Returns////// A boolean tensor with a single element indicating whether the tensor contains any NaN values.pubfncontains_nan(&self) -> Tensor<B,1,Bool>{// Summing the tensor will result in NaN if the tensor contains any NaN values// This is faster than checking each element individually// because it rolls up the NaN values into a single valuelet sum = K::sum(self.primitive.clone());// Check if the sum is NaN by comparing it to itselfK::not_equal(sum.clone(), sum)}
antimora
changed the title
NaN related ops are not correct for burn-wgpu backend
NaN related ops are not correct for burn-wgpu fusion backend
Aug 3, 2024
I am adding two new tensor methods related to NaN (is_nan and contains_nan). My unit tests are failing for burn-wgpu backend. See #2088 PR
Describe the bug
These two methods do not work as expected:
To Reproduce
Expected behavior
The tests should pass.
Screenshots
NOTE: The unit test should be enabled currently ignored for all backends.
The text was updated successfully, but these errors were encountered: