Bool

Struct 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

Source§

type InnerKind = Bool

Inner primitive tensor.
Source§

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

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

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

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

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

Source§

type Elem = <B as Backend>::BoolElem

The type of the tensor elements.
Source§

fn empty(shape: Shape, device: &Device<B>, dtype: DType) -> Self::Primitive

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

fn zeros(shape: Shape, device: &Device<B>, dtype: DType) -> Self::Primitive

Creates a tensor filled with zeros. Read more
Source§

fn ones(shape: Shape, device: &Device<B>, dtype: DType) -> Self::Primitive

Creates a tensor filled with ones. Read more
Source§

fn full<E: ElementConversion>( shape: Shape, fill_value: E, device: &Device<B>, dtype: DType, ) -> Self::Primitive

Creates a tensor of the given shape where each element is equal to the provided value. Read more
Source§

fn register_transaction( tr: &mut TransactionPrimitive<B>, tensor: Self::Primitive, )

Read the data from the tensor using a transaction. Read more
Source§

fn reshape(tensor: Self::Primitive, shape: Shape) -> Self::Primitive

Reshapes the tensor. Read more
Source§

fn transpose(tensor: Self::Primitive) -> Self::Primitive

Transposes a tensor. Read more
Source§

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

Swaps two dimensions of a tensor. Read more
Source§

fn slice(tensor: Self::Primitive, slices: &[Slice]) -> Self::Primitive

Select tensor elements corresponding to the given slices. Read more
Source§

fn slice_assign( tensor: Self::Primitive, slices: &[Slice], value: Self::Primitive, ) -> Self::Primitive

Assigns the given value to the tensor elements corresponding to the given slices. Read more
Source§

fn select( tensor: Self::Primitive, dim: usize, indices: IntTensor<B>, ) -> Self::Primitive

Select tensor elements along the given dimension corresponding to the given indices. Read more
Source§

fn select_assign( tensor: Self::Primitive, dim: usize, indices: IntTensor<B>, values: Self::Primitive, update: IndexingUpdateOp, ) -> Self::Primitive

Assign the selected elements along the given dimension corresponding to the given indices from the value tensor. Read more
Source§

fn mask_where( tensor: Self::Primitive, mask: B::BoolTensorPrimitive, source: Self::Primitive, ) -> Self::Primitive

Selects elements from a tensor based on a boolean mask. Read more
Source§

fn mask_fill( tensor: Self::Primitive, mask: B::BoolTensorPrimitive, value: Self::Elem, ) -> Self::Primitive

Fills elements of a tensor based on a boolean mask. Read more
Source§

fn gather( dim: usize, tensor: Self::Primitive, indices: B::IntTensorPrimitive, ) -> Self::Primitive

Gathers elements from a tensor along an axis. Read more
Source§

fn scatter( dim: usize, tensor: Self::Primitive, indices: B::IntTensorPrimitive, values: Self::Primitive, update: IndexingUpdateOp, ) -> Self::Primitive

Scatters elements into a tensor along an axis. Read more
Source§

fn device(tensor: &Self::Primitive) -> Device<B>

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

fn to_device(tensor: Self::Primitive, device: &Device<B>) -> Self::Primitive

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

async fn into_data_async( tensor: Self::Primitive, ) -> Result<TensorData, ExecutionError>

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

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

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

fn from_data_dtype( data: TensorData, device: &Device<B>, dtype: DType, ) -> Self::Primitive

Creates a tensor from the given data enforcing the given data type. Read more
Source§

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

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

fn equal(lhs: Self::Primitive, rhs: Self::Primitive) -> B::BoolTensorPrimitive

Equates the given tensors. Read more
Source§

fn not_equal( lhs: Self::Primitive, rhs: Self::Primitive, ) -> B::BoolTensorPrimitive

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

fn equal_elem(lhs: Self::Primitive, rhs: Self::Elem) -> B::BoolTensorPrimitive

Element-wise equality between two tensors. Read more
Source§

fn not_equal_elem( lhs: Self::Primitive, rhs: Self::Elem, ) -> B::BoolTensorPrimitive

Element-wise non-equality between two tensors. Read more
Source§

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

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

fn any(tensor: Self::Primitive) -> B::BoolTensorPrimitive

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

fn any_dim(tensor: Self::Primitive, dim: usize) -> B::BoolTensorPrimitive

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

fn all(tensor: Self::Primitive) -> B::BoolTensorPrimitive

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

fn all_dim(tensor: Self::Primitive, dim: usize) -> B::BoolTensorPrimitive

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

fn permute(tensor: Self::Primitive, axes: &[usize]) -> Self::Primitive

Permutes the dimensions of a tensor. Read more
Source§

fn expand(tensor: Self::Primitive, shape: Shape) -> Self::Primitive

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

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

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

fn unfold( tensor: Self::Primitive, dim: usize, size: usize, step: usize, ) -> Self::Primitive

Unfold windows along a dimension. Read more
Source§

fn elem_type_name() -> &'static str

Returns the name of the element type.
Source§

fn dtype(tensor: &Self::Primitive) -> DType

Returns the tensor data type.
Source§

impl Clone for Bool

Source§

fn clone(&self) -> Bool

Returns a duplicate of the value. Read more
1.0.0§

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

Source§

type Primitive = <B as Backend>::BoolTensorPrimitive

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§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

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