ella_tensor/ops/
boolean.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{Shape, Tensor, TensorValue};

impl<T, S> Tensor<T, S>
where
    T: TensorValue<Unmasked = bool>,
    S: Shape,
{
    pub fn all(&self) -> bool {
        self.iter_valid().all(|v| v)
    }

    pub fn any(&self) -> bool {
        self.iter_valid().any(|v| v)
    }
}