Function dfdx::tensor_ops::bool_not
source · pub fn bool_not<S: Shape, E: Dtype, D: Device<E>>(
inp: &Tensor<S, bool, D>
) -> Tensor<S, bool, D>
Expand description
Inverts each value in a boolean tensor.
Example:
let a = dev.tensor([false, true, false]);
// Can take either a reference or an owned value
let r1 = !&a;
let r2 = !a;
assert_eq!(r1.array(), [true, false, true]);
assert_eq!(r2.array(), [true, false, true]);