Struct burn_tensor::Bool

source ·
pub struct Bool;
Expand description

A type-level representation of the kind of a bool tensor.

Trait Implementations§

source§

impl<B: AutodiffBackend> BasicAutodiffOps<B> for Bool

§

type InnerKind = Bool

Inner primitive tensor.
source§

fn inner<const D: usize>( tensor: <Self as TensorKind<B>>::Primitive<D>, ) -> <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive<D>

Returns the inner tensor without the autodiff information. Read more
source§

fn from_inner<const D: usize>( inner: <Self::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive<D>, ) -> <Self as TensorKind<B>>::Primitive<D>

Convert a tensor to the autodiff backend. Read more
source§

impl<B: Backend> BasicOps<B> for Bool

§

type Elem = bool

The type of the tensor elements.
source§

fn empty<const D: usize>( shape: Shape<D>, device: &B::Device, ) -> Self::Primitive<D>

Creates an empty tensor with the given shape. Read more
source§

fn shape<const D: usize>(tensor: &Self::Primitive<D>) -> Shape<D>

Returns the shape of the tensor. Read more
source§

fn reshape<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, shape: Shape<D2>, ) -> Self::Primitive<D2>

Reshapes the tensor. Read more
source§

fn transpose<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<D>

Transposes a tensor. Read more
source§

fn swap_dims<const D: usize>( tensor: Self::Primitive<D>, dim1: usize, dim2: usize, ) -> Self::Primitive<D>

Swaps two dimensions of a tensor. Read more
source§

fn slice<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, ranges: [Range<usize>; D2], ) -> Self::Primitive<D1>

Select tensor elements corresponding for the given ranges. Read more
source§

fn slice_assign<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, ranges: [Range<usize>; D2], value: Self::Primitive<D1>, ) -> Self::Primitive<D1>

Assigns the given value to the tensor elements corresponding for the given ranges. Read more
source§

fn device<const D: usize>(tensor: &Self::Primitive<D>) -> <B as Backend>::Device

Returns the device on which the tensor is allocated. Read more
source§

fn to_device<const D: usize>( tensor: Self::Primitive<D>, device: &<B as Backend>::Device, ) -> Self::Primitive<D>

Moves the tensor to the given device. Read more
source§

async fn into_data_async<const D: usize>( tensor: Self::Primitive<D>, ) -> TensorData

Extracts the data from the tensor asynchronously. Read more
source§

fn from_data<const D: usize>( data: TensorData, device: &B::Device, ) -> Self::Primitive<D>

Creates a tensor from the given data. Read more
source§

fn repeat_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize, times: usize, ) -> Self::Primitive<D>

Repeat the tensor along the given dimension. Read more
source§

fn equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D>, ) -> Tensor<B, D, Bool>

Equates the given tensors. Read more
source§

fn not_equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D>, ) -> Tensor<B, D, Bool>

Applies element-wise non-equality comparison between the given tensors. Read more
source§

fn cat<const D: usize>( vectors: Vec<Self::Primitive<D>>, dim: usize, ) -> Self::Primitive<D>

Concatenates the given tensors along the given dimension. Read more
source§

fn any<const D: usize>(tensor: Self::Primitive<D>) -> Tensor<B, 1, Bool>

Tests if any element in the tensor evaluates to True. Read more
source§

fn any_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize, ) -> Tensor<B, D, Bool>

Tests if any element in the tensor evaluates to True along a given dimension dim. Read more
source§

fn all<const D: usize>(tensor: Self::Primitive<D>) -> Tensor<B, 1, Bool>

Tests if all elements in the tensor evaluate to True. Read more
source§

fn all_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize, ) -> Tensor<B, D, Bool>

Tests if all elements in the tensor evaluate to True along a given dimension dim. Read more
source§

fn permute<const D: usize>( tensor: Self::Primitive<D>, axes: [usize; D], ) -> Self::Primitive<D>

Permutes the dimensions of a tensor. Read more
source§

fn expand<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, shape: Shape<D2>, ) -> Self::Primitive<D2>

Broadcasts the given tensor to the specified shape. Read more
source§

fn flip<const D: usize>( tensor: Self::Primitive<D>, axes: &[usize], ) -> Self::Primitive<D>

Flips the tensor along the given axes. Read more
source§

fn elem_type_name() -> &'static str

Returns the name of the element type.
source§

impl Clone for Bool

source§

fn clone(&self) -> Bool

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 Debug for Bool

source§

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

Formats the value using the given formatter. Read more
source§

impl<B: Backend> TensorKind<B> for Bool

§

type Primitive<const D: usize> = <B as Backend>::BoolTensorPrimitive<D>

The primitive type of the tensor.
source§

fn name() -> &'static str

The name of the tensor kind.

Auto Trait Implementations§

§

impl Freeze for Bool

§

impl RefUnwindSafe for Bool

§

impl Send for Bool

§

impl Sync for Bool

§

impl Unpin for Bool

§

impl UnwindSafe for Bool

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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> ToOwned for T
where 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 T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

source§

fn vzip(self) -> V