Struct burn::prelude::Bool

pub struct Bool;
Expand description

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

Trait Implementations§

§

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

§

type InnerKind = Bool

Inner primitive tensor.
§

fn inner( tensor: <Bool as TensorKind<B>>::Primitive, ) -> <<Bool as BasicAutodiffOps<B>>::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive

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

fn from_inner( inner: <<Bool as BasicAutodiffOps<B>>::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive, ) -> <Bool as TensorKind<B>>::Primitive

Convert a tensor to the autodiff backend. Read more
§

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

§

type Elem = bool

The type of the tensor elements.
§

fn empty( shape: Shape, device: &<B as Backend>::Device, ) -> <Bool as TensorKind<B>>::Primitive

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

fn shape(tensor: &<Bool as TensorKind<B>>::Primitive) -> Shape

Returns the shape of the tensor. Read more
§

fn reshape( tensor: <Bool as TensorKind<B>>::Primitive, shape: Shape, ) -> <Bool as TensorKind<B>>::Primitive

Reshapes the tensor. Read more
§

fn transpose( tensor: <Bool as TensorKind<B>>::Primitive, ) -> <Bool as TensorKind<B>>::Primitive

Transposes a tensor. Read more
§

fn swap_dims( tensor: <Bool as TensorKind<B>>::Primitive, dim1: usize, dim2: usize, ) -> <Bool as TensorKind<B>>::Primitive

Swaps two dimensions of a tensor. Read more
§

fn slice( tensor: <Bool as TensorKind<B>>::Primitive, ranges: &[Range<usize>], ) -> <Bool as TensorKind<B>>::Primitive

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

fn slice_assign( tensor: <Bool as TensorKind<B>>::Primitive, ranges: &[Range<usize>], value: <Bool as TensorKind<B>>::Primitive, ) -> <Bool as TensorKind<B>>::Primitive

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

fn device(tensor: &<Bool as TensorKind<B>>::Primitive) -> <B as Backend>::Device

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

fn to_device( tensor: <Bool as TensorKind<B>>::Primitive, device: &<B as Backend>::Device, ) -> <Bool as TensorKind<B>>::Primitive

Moves the tensor to the given device. Read more
§

async fn into_data_async( tensor: <Bool as TensorKind<B>>::Primitive, ) -> TensorData

Extracts the data from the tensor asynchronously. Read more
§

fn from_data( data: TensorData, device: &<B as Backend>::Device, ) -> <Bool as TensorKind<B>>::Primitive

Creates a tensor from the given data. Read more
§

fn repeat_dim( tensor: <Bool as TensorKind<B>>::Primitive, dim: usize, times: usize, ) -> <Bool as TensorKind<B>>::Primitive

Repeat the tensor along the given dimension. Read more
§

fn equal( lhs: <Bool as TensorKind<B>>::Primitive, rhs: <Bool as TensorKind<B>>::Primitive, ) -> <B as Backend>::BoolTensorPrimitive

Equates the given tensors. Read more
§

fn not_equal( lhs: <Bool as TensorKind<B>>::Primitive, rhs: <Bool as TensorKind<B>>::Primitive, ) -> <B as Backend>::BoolTensorPrimitive

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

fn cat( vectors: Vec<<Bool as TensorKind<B>>::Primitive>, dim: usize, ) -> <Bool as TensorKind<B>>::Primitive

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

fn any( tensor: <Bool as TensorKind<B>>::Primitive, ) -> <B as Backend>::BoolTensorPrimitive

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

fn any_dim( tensor: <Bool as TensorKind<B>>::Primitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive

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

fn all( tensor: <Bool as TensorKind<B>>::Primitive, ) -> <B as Backend>::BoolTensorPrimitive

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

fn all_dim( tensor: <Bool as TensorKind<B>>::Primitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive

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

fn permute( tensor: <Bool as TensorKind<B>>::Primitive, axes: &[usize], ) -> <Bool as TensorKind<B>>::Primitive

Permutes the dimensions of a tensor. Read more
§

fn expand( tensor: <Bool as TensorKind<B>>::Primitive, shape: Shape, ) -> <Bool as TensorKind<B>>::Primitive

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

fn flip( tensor: <Bool as TensorKind<B>>::Primitive, axes: &[usize], ) -> <Bool as TensorKind<B>>::Primitive

Flips the tensor along the given axes. Read more
§

fn chunk( tensor: <Bool as TensorKind<B>>::Primitive, chunks: usize, dim: usize, ) -> Vec<<Bool as TensorKind<B>>::Primitive>

Attempts to split the tensor along the given dimension into chunks. May return less chunks than requested if the tensor size is not divisible by the number of chunks. Read more
§

fn elem_type_name() -> &'static str

Returns the name of the element type.
§

impl Clone for Bool

§

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
§

impl Debug for Bool

§

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

Formats the value using the given formatter. Read more
§

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

§

type Primitive = <B as Backend>::BoolTensorPrimitive

The primitive type of the tensor.
§

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§

§

impl<T> Adaptor<()> for T

§

fn adapt(&self)

Adapt the type to be passed to a metric.
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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

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

source§

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>,

source§

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>,

source§

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

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,