pub struct Bool;Expand description
A type-level representation of the kind of a bool tensor.
Trait Implementations§
Source§impl<B> BasicAutodiffOps<B> for Boolwhere
B: AutodiffBackend,
impl<B> BasicAutodiffOps<B> for Boolwhere
B: AutodiffBackend,
Source§fn inner(
tensor: <Bool as TensorKind<B>>::Primitive,
) -> <<Bool as BasicAutodiffOps<B>>::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive
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
Source§fn from_inner(
inner: <<Bool as BasicAutodiffOps<B>>::InnerKind as TensorKind<<B as AutodiffBackend>::InnerBackend>>::Primitive,
) -> <Bool as TensorKind<B>>::Primitive
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
Source§impl<B> BasicOps<B> for Boolwhere
B: Backend,
impl<B> BasicOps<B> for Boolwhere
B: Backend,
Source§fn empty(
shape: Shape,
device: &<B as Backend>::Device,
dtype: DType,
) -> <Bool as TensorKind<B>>::Primitive
fn empty( shape: Shape, device: &<B as Backend>::Device, dtype: DType, ) -> <Bool as TensorKind<B>>::Primitive
Creates an empty tensor with the given shape. Read more
Source§fn zeros(
shape: Shape,
device: &<B as Backend>::Device,
dtype: DType,
) -> <Bool as TensorKind<B>>::Primitive
fn zeros( shape: Shape, device: &<B as Backend>::Device, dtype: DType, ) -> <Bool as TensorKind<B>>::Primitive
Creates a tensor filled with zeros. Read more
Source§fn ones(
shape: Shape,
device: &<B as Backend>::Device,
dtype: DType,
) -> <Bool as TensorKind<B>>::Primitive
fn ones( shape: Shape, device: &<B as Backend>::Device, dtype: DType, ) -> <Bool as TensorKind<B>>::Primitive
Creates a tensor filled with ones. Read more
Source§fn full<E>(
shape: Shape,
fill_value: E,
device: &<B as Backend>::Device,
dtype: DType,
) -> <Bool as TensorKind<B>>::Primitivewhere
E: ElementConversion,
fn full<E>(
shape: Shape,
fill_value: E,
device: &<B as Backend>::Device,
dtype: DType,
) -> <Bool as TensorKind<B>>::Primitivewhere
E: ElementConversion,
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: <Bool as TensorKind<B>>::Primitive,
)
fn register_transaction( tr: &mut TransactionPrimitive<B>, tensor: <Bool as TensorKind<B>>::Primitive, )
Read the data from the tensor using a transaction. Read more
Source§fn reshape(
tensor: <Bool as TensorKind<B>>::Primitive,
shape: Shape,
) -> <Bool as TensorKind<B>>::Primitive
fn reshape( tensor: <Bool as TensorKind<B>>::Primitive, shape: Shape, ) -> <Bool as TensorKind<B>>::Primitive
Reshapes the tensor. Read more
Source§fn transpose(
tensor: <Bool as TensorKind<B>>::Primitive,
) -> <Bool as TensorKind<B>>::Primitive
fn transpose( tensor: <Bool as TensorKind<B>>::Primitive, ) -> <Bool as TensorKind<B>>::Primitive
Transposes a tensor. Read more
Source§fn swap_dims(
tensor: <Bool as TensorKind<B>>::Primitive,
dim1: usize,
dim2: usize,
) -> <Bool as TensorKind<B>>::Primitive
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
Source§fn slice(
tensor: <Bool as TensorKind<B>>::Primitive,
slices: &[Slice],
) -> <Bool as TensorKind<B>>::Primitive
fn slice( tensor: <Bool as TensorKind<B>>::Primitive, slices: &[Slice], ) -> <Bool as TensorKind<B>>::Primitive
Select tensor elements corresponding to the given slices. Read more
Source§fn slice_assign(
tensor: <Bool as TensorKind<B>>::Primitive,
slices: &[Slice],
value: <Bool as TensorKind<B>>::Primitive,
) -> <Bool as TensorKind<B>>::Primitive
fn slice_assign( tensor: <Bool as TensorKind<B>>::Primitive, slices: &[Slice], value: <Bool as TensorKind<B>>::Primitive, ) -> <Bool as TensorKind<B>>::Primitive
Assigns the given value to the tensor elements corresponding to the given slices. Read more
Source§fn select(
tensor: <Bool as TensorKind<B>>::Primitive,
dim: usize,
indices: <B as Backend>::IntTensorPrimitive,
) -> <Bool as TensorKind<B>>::Primitive
fn select( tensor: <Bool as TensorKind<B>>::Primitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, ) -> <Bool as TensorKind<B>>::Primitive
Select tensor elements along the given dimension corresponding to the given indices. Read more
Source§fn select_assign(
tensor: <Bool as TensorKind<B>>::Primitive,
dim: usize,
indices: <B as Backend>::IntTensorPrimitive,
values: <Bool as TensorKind<B>>::Primitive,
update: IndexingUpdateOp,
) -> <Bool as TensorKind<B>>::Primitive
fn select_assign( tensor: <Bool as TensorKind<B>>::Primitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, values: <Bool as TensorKind<B>>::Primitive, update: IndexingUpdateOp, ) -> <Bool as TensorKind<B>>::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: <Bool as TensorKind<B>>::Primitive,
mask: <B as Backend>::BoolTensorPrimitive,
source: <Bool as TensorKind<B>>::Primitive,
) -> <Bool as TensorKind<B>>::Primitive
fn mask_where( tensor: <Bool as TensorKind<B>>::Primitive, mask: <B as Backend>::BoolTensorPrimitive, source: <Bool as TensorKind<B>>::Primitive, ) -> <Bool as TensorKind<B>>::Primitive
Selects elements from a tensor based on a boolean mask. Read more
Source§fn mask_fill(
tensor: <Bool as TensorKind<B>>::Primitive,
mask: <B as Backend>::BoolTensorPrimitive,
value: <Bool as BasicOps<B>>::Elem,
) -> <Bool as TensorKind<B>>::Primitive
fn mask_fill( tensor: <Bool as TensorKind<B>>::Primitive, mask: <B as Backend>::BoolTensorPrimitive, value: <Bool as BasicOps<B>>::Elem, ) -> <Bool as TensorKind<B>>::Primitive
Fills elements of a tensor based on a boolean mask. Read more
Source§fn gather(
dim: usize,
tensor: <Bool as TensorKind<B>>::Primitive,
indices: <B as Backend>::IntTensorPrimitive,
) -> <Bool as TensorKind<B>>::Primitive
fn gather( dim: usize, tensor: <Bool as TensorKind<B>>::Primitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <Bool as TensorKind<B>>::Primitive
Gathers elements from a tensor along an axis. Read more
Source§fn scatter(
dim: usize,
tensor: <Bool as TensorKind<B>>::Primitive,
indices: <B as Backend>::IntTensorPrimitive,
values: <Bool as TensorKind<B>>::Primitive,
update: IndexingUpdateOp,
) -> <Bool as TensorKind<B>>::Primitive
fn scatter( dim: usize, tensor: <Bool as TensorKind<B>>::Primitive, indices: <B as Backend>::IntTensorPrimitive, values: <Bool as TensorKind<B>>::Primitive, update: IndexingUpdateOp, ) -> <Bool as TensorKind<B>>::Primitive
Scatters elements into a tensor along an axis. Read more
Source§fn device(tensor: &<Bool as TensorKind<B>>::Primitive) -> <B as Backend>::Device
fn device(tensor: &<Bool as TensorKind<B>>::Primitive) -> <B as Backend>::Device
Returns the device on which the tensor is allocated. Read more
Source§fn to_device(
tensor: <Bool as TensorKind<B>>::Primitive,
device: &<B as Backend>::Device,
) -> <Bool as TensorKind<B>>::Primitive
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
Source§async fn into_data_async(
tensor: <Bool as TensorKind<B>>::Primitive,
) -> Result<TensorData, ExecutionError>
async fn into_data_async( tensor: <Bool as TensorKind<B>>::Primitive, ) -> Result<TensorData, ExecutionError>
Extracts the data from the tensor asynchronously. Read more
Source§fn from_data(
data: TensorData,
device: &<B as Backend>::Device,
) -> <Bool as TensorKind<B>>::Primitive
fn from_data( data: TensorData, device: &<B as Backend>::Device, ) -> <Bool as TensorKind<B>>::Primitive
Creates a tensor from the given data. Read more
Source§fn from_data_dtype(
data: TensorData,
device: &<B as Backend>::Device,
dtype: DType,
) -> <Bool as TensorKind<B>>::Primitive
fn from_data_dtype( data: TensorData, device: &<B as Backend>::Device, dtype: DType, ) -> <Bool as TensorKind<B>>::Primitive
Creates a tensor from the given data enforcing the given data type. Read more
Source§fn repeat_dim(
tensor: <Bool as TensorKind<B>>::Primitive,
dim: usize,
times: usize,
) -> <Bool as TensorKind<B>>::Primitive
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
Source§fn equal(
lhs: <Bool as TensorKind<B>>::Primitive,
rhs: <Bool as TensorKind<B>>::Primitive,
) -> <B as Backend>::BoolTensorPrimitive
fn equal( lhs: <Bool as TensorKind<B>>::Primitive, rhs: <Bool as TensorKind<B>>::Primitive, ) -> <B as Backend>::BoolTensorPrimitive
Equates the given tensors. Read more
Source§fn not_equal(
lhs: <Bool as TensorKind<B>>::Primitive,
rhs: <Bool as TensorKind<B>>::Primitive,
) -> <B as Backend>::BoolTensorPrimitive
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
Source§fn equal_elem(
lhs: <Bool as TensorKind<B>>::Primitive,
rhs: <Bool as BasicOps<B>>::Elem,
) -> <B as Backend>::BoolTensorPrimitive
fn equal_elem( lhs: <Bool as TensorKind<B>>::Primitive, rhs: <Bool as BasicOps<B>>::Elem, ) -> <B as Backend>::BoolTensorPrimitive
Element-wise equality between two tensors. Read more
Source§fn not_equal_elem(
lhs: <Bool as TensorKind<B>>::Primitive,
rhs: <Bool as BasicOps<B>>::Elem,
) -> <B as Backend>::BoolTensorPrimitive
fn not_equal_elem( lhs: <Bool as TensorKind<B>>::Primitive, rhs: <Bool as BasicOps<B>>::Elem, ) -> <B as Backend>::BoolTensorPrimitive
Element-wise non-equality between two tensors. Read more
Source§fn cat(
vectors: Vec<<Bool as TensorKind<B>>::Primitive>,
dim: usize,
) -> <Bool as TensorKind<B>>::Primitive
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
Source§fn any(
tensor: <Bool as TensorKind<B>>::Primitive,
) -> <B as Backend>::BoolTensorPrimitive
fn any( tensor: <Bool as TensorKind<B>>::Primitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if any element in the
tensor evaluates to True. Read moreSource§fn any_dim(
tensor: <Bool as TensorKind<B>>::Primitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
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
Source§fn all(
tensor: <Bool as TensorKind<B>>::Primitive,
) -> <B as Backend>::BoolTensorPrimitive
fn all( tensor: <Bool as TensorKind<B>>::Primitive, ) -> <B as Backend>::BoolTensorPrimitive
Tests if all elements in the
tensor evaluate to True. Read moreSource§fn all_dim(
tensor: <Bool as TensorKind<B>>::Primitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn all_dim( tensor: <Bool as TensorKind<B>>::Primitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Source§fn permute(
tensor: <Bool as TensorKind<B>>::Primitive,
axes: &[usize],
) -> <Bool as TensorKind<B>>::Primitive
fn permute( tensor: <Bool as TensorKind<B>>::Primitive, axes: &[usize], ) -> <Bool as TensorKind<B>>::Primitive
Permutes the dimensions of a tensor. Read more
Source§fn expand(
tensor: <Bool as TensorKind<B>>::Primitive,
shape: Shape,
) -> <Bool as TensorKind<B>>::Primitive
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
Source§fn flip(
tensor: <Bool as TensorKind<B>>::Primitive,
axes: &[usize],
) -> <Bool as TensorKind<B>>::Primitive
fn flip( tensor: <Bool as TensorKind<B>>::Primitive, axes: &[usize], ) -> <Bool as TensorKind<B>>::Primitive
Flips the tensor along the given axes. Read more
Source§fn unfold(
tensor: <Bool as TensorKind<B>>::Primitive,
dim: usize,
size: usize,
step: usize,
) -> <Bool as TensorKind<B>>::Primitive
fn unfold( tensor: <Bool as TensorKind<B>>::Primitive, dim: usize, size: usize, step: usize, ) -> <Bool as TensorKind<B>>::Primitive
Unfold windows along a dimension. Read more
Source§fn elem_type_name() -> &'static str
fn elem_type_name() -> &'static str
Returns the name of the element type.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)