Function dfdx::tensor_ops::nans_to
source · [−]Expand description
Replaces any nans in t
with value
.
Examples
let t: Tensor1D<4> = Tensor1D::new([1.0, f32::NAN, f32::NAN, 4.0]);
let r = t.nans_to(0.0);
assert_eq!(r.data(), &[1.0, 0.0, 0.0, 4.0]);