Struct burn_tensor::BoolTensor

source ·
pub struct BoolTensor<B: Backend, const D: usize> { /* private fields */ }

Implementations§

source§

impl<B, const D: usize> BoolTensor<B, D>where B: Backend,

source

pub fn new(tensor: B::BoolTensorPrimitive<D>) -> Self

source

pub fn shape(&self) -> Shape<D>

source

pub fn to_device(&self, device: &B::Device) -> Self

source

pub fn dims(&self) -> [usize; D]

Returns the dimensions of the current tensor.

Equivalent to tensor.shape().dims.

source

pub fn into_data(self) -> Data<bool, D>

source

pub fn to_data(&self) -> Data<bool, D>

source

pub fn from_data(data: Data<bool, D>) -> Self

source

pub fn to_int(&self) -> Tensor<B::IntegerBackend, D>

source

pub fn from_int_backend(tensor: BoolTensor<B::IntegerBackend, D>) -> Self

source

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.

source

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,

source§

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)

Performs copy-assignment from source. Read more
source§

impl<B: Debug + Backend, const D: usize> Debug for BoolTensor<B, D>where B::BoolTensorPrimitive<D>: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

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

Checks if self is actually part of its subset T (and can be converted to it).
§

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

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V