Struct burn_tensor::BoolTensor
source · Implementations§
source§impl<B, const D: usize> BoolTensor<B, D>where
B: Backend,
impl<B, const D: usize> BoolTensor<B, D>where
B: Backend,
pub fn new(tensor: B::BoolTensorPrimitive<D>) -> Self
pub fn shape(&self) -> &Shape<D>
pub fn to_device(&self, device: B::Device) -> Self
sourcepub fn dims(&self) -> [usize; D]
pub fn dims(&self) -> [usize; D]
Returns the dimensions of the current tensor.
Equivalent to tensor.shape().dims.
pub fn into_data(self) -> Data<bool, D>
pub fn to_data(&self) -> Data<bool, D>
pub fn from_data(data: Data<bool, D>) -> Self
pub fn to_int(&self) -> Tensor<B::IntegerBackend, D>
pub fn from_int_backend(tensor: BoolTensor<B::IntegerBackend, D>) -> Self
sourcepub fn reshape<const D2: usize, S: Into<Shape<D2>>>(
&self,
shape: S
) -> BoolTensor<B, D2>
pub fn reshape<const D2: usize, S: Into<Shape<D2>>>(
&self,
shape: S
) -> BoolTensor<B, D2>
Reshape the tensor to have the given shape.
Panics
If the tensor can not be reshape to the given shape.
pub fn index<const D2: usize>(&self, indexes: [Range<usize>; D2]) -> Self
Trait Implementations§
source§impl<B: Clone + Backend, const D: usize> Clone for BoolTensor<B, D>where
B::BoolTensorPrimitive<D>: Clone,
impl<B: Clone + Backend, const D: usize> Clone for BoolTensor<B, D>where
B::BoolTensorPrimitive<D>: Clone,
source§fn clone(&self) -> BoolTensor<B, D>
fn clone(&self) -> BoolTensor<B, D>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<B, const D: usize> RefUnwindSafe for BoolTensor<B, D>where
<B as Backend>::BoolTensorPrimitive<D>: RefUnwindSafe,
impl<B, const D: usize> Send for BoolTensor<B, D>
impl<B, const D: usize> Sync for BoolTensor<B, D>
impl<B, const D: usize> Unpin for BoolTensor<B, D>where
<B as Backend>::BoolTensorPrimitive<D>: Unpin,
impl<B, const D: usize> UnwindSafe for BoolTensor<B, D>where
<B as Backend>::BoolTensorPrimitive<D>: UnwindSafe,
Blanket Implementations§
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.