use crate::{backend::Backend, Bool, Data, Int, Tensor};
impl<B, const D: usize> Tensor<B, D, Bool>
where
B: Backend,
{
pub fn from_bool(data: Data<bool, D>) -> Self {
Self::new(B::bool_from_data(data, &B::Device::default()))
}
pub fn from_bool_device(data: Data<bool, D>, device: &B::Device) -> Self {
Self::new(B::bool_from_data(data, device))
}
pub fn int(self) -> Tensor<B, D, Int> {
Tensor::new(B::bool_into_int(self.primitive))
}
pub fn float(self) -> Tensor<B, D> {
Tensor::new(B::bool_into_float(self.primitive))
}
pub fn bool_not(self) -> Self {
Tensor::new(B::bool_not(self.primitive))
}
}