pub type TensorAny<R, T, B, D> = TensorBase<Storage<R, T, B>, D>;
Aliased Type§
struct TensorAny<R, T, B, D> { /* private fields */ }
Implementations§
Source§impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
D: DimAPI + DimSmallerOneAPI,
D::SmallerOne: DimAPI,
B: DeviceAPI<T> + DeviceIndexSelectAPI<T, D> + DeviceCreationAnyAPI<T>,
impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
D: DimAPI + DimSmallerOneAPI,
D::SmallerOne: DimAPI,
B: DeviceAPI<T> + DeviceIndexSelectAPI<T, D> + DeviceCreationAnyAPI<T>,
pub fn index_select_f<I>( &self, axis: isize, indices: I, ) -> Result<Tensor<T, B, D>>
Sourcepub fn index_select<I>(&self, axis: isize, indices: I) -> Tensor<T, B, D>
pub fn index_select<I>(&self, axis: isize, indices: I) -> Tensor<T, B, D>
Returns a new tensor, which indexes the input tensor along dimension
axis
using the entries in indices
.
§See also
This function should be similar to PyTorch’s torch.index_select
.
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn zeros_like(&self) -> Tensor<T, B, D>
pub fn zeros_like(&self) -> Tensor<T, B, D>
pub fn zeros_like_f(&self) -> Result<Tensor<T, B, D>>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn into_slice_f<I>(self, index: I) -> Result<TensorAny<R, T, B, IxD>>
pub fn into_slice<I>(self, index: I) -> TensorAny<R, T, B, IxD>
pub fn slice_f<I>(&self, index: I) -> Result<TensorView<'_, T, B, IxD>>
pub fn slice<I>(&self, index: I) -> TensorView<'_, T, B, IxD>
pub fn i_f<I>(&self, index: I) -> Result<TensorView<'_, T, B, IxD>>
pub fn i<I>(&self, index: I) -> TensorView<'_, T, B, IxD>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn slice_mut_f<I>(&mut self, index: I) -> Result<TensorMut<'_, T, B, IxD>>
pub fn slice_mut<I>(&mut self, index: I) -> TensorMut<'_, T, B, IxD>
pub fn i_mut_f<I>(&mut self, index: I) -> Result<TensorMut<'_, T, B, IxD>>
pub fn i_mut<I>(&mut self, index: I) -> TensorMut<'_, T, B, IxD>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn into_diagonal_f( self, diagonal_args: impl Into<DiagonalArgs>, ) -> Result<TensorAny<R, T, B, D::SmallerOne>>
pub fn into_diagonal( self, diagonal_args: impl Into<DiagonalArgs>, ) -> TensorAny<R, T, B, D::SmallerOne>
pub fn diagonal_f( &self, diagonal_args: impl Into<DiagonalArgs>, ) -> Result<TensorView<'_, T, B, D::SmallerOne>>
pub fn diagonal( &self, diagonal_args: impl Into<DiagonalArgs>, ) -> TensorView<'_, T, B, D::SmallerOne>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataMutAPI<Data = B::Raw>,
B: DeviceAPI<T>,
D: DimAPI + DimSmallerOneAPI,
D::SmallerOne: DimAPI,
impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataMutAPI<Data = B::Raw>,
B: DeviceAPI<T>,
D: DimAPI + DimSmallerOneAPI,
D::SmallerOne: DimAPI,
pub fn into_diagonal_mut_f( self, diagonal_args: impl Into<DiagonalArgs>, ) -> Result<TensorAny<R, T, B, D::SmallerOne>>
pub fn into_diagonal_mut( self, diagonal_args: impl Into<DiagonalArgs>, ) -> TensorAny<R, T, B, D::SmallerOne>
pub fn diagonal_mut_f( &mut self, diagonal_args: impl Into<DiagonalArgs>, ) -> Result<TensorMut<'_, T, B, D::SmallerOne>>
pub fn diagonal_mut( &mut self, diagonal_args: impl Into<DiagonalArgs>, ) -> TensorMut<'_, T, B, D::SmallerOne>
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>
impl<'a, R, T, B, D> TensorAny<R, T, B, D>
pub fn axes_iter_with_order_f<I>( &self, axes: I, order: TensorIterOrder, ) -> Result<IterAxesView<'a, T, B>>
pub fn axes_iter_f<I>(&self, axes: I) -> Result<IterAxesView<'a, T, B>>
pub fn axes_iter_with_order<I>( &self, axes: I, order: TensorIterOrder, ) -> IterAxesView<'a, T, B> ⓘ
pub fn axes_iter<I>(&self, axes: I) -> IterAxesView<'a, T, B> ⓘ
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>
impl<'a, R, T, B, D> TensorAny<R, T, B, D>
pub fn axes_iter_mut_with_order_f<I>( &'a mut self, axes: I, order: TensorIterOrder, ) -> Result<IterAxesMut<'a, T, B>>
pub fn axes_iter_mut_f<I>( &'a mut self, axes: I, ) -> Result<IterAxesMut<'a, T, B>>
pub fn axes_iter_mut_with_order<I>( &'a mut self, axes: I, order: TensorIterOrder, ) -> IterAxesMut<'a, T, B> ⓘ
pub fn axes_iter_mut<I>(&'a mut self, axes: I) -> IterAxesMut<'a, T, B> ⓘ
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>
impl<'a, R, T, B, D> TensorAny<R, T, B, D>
pub fn indexed_axes_iter_with_order_f<I>( &self, axes: I, order: TensorIterOrder, ) -> Result<IndexedIterAxesView<'a, T, B>>
pub fn indexed_axes_iter_f<I>( &self, axes: I, ) -> Result<IndexedIterAxesView<'a, T, B>>
pub fn indexed_axes_iter_with_order<I>( &self, axes: I, order: TensorIterOrder, ) -> IndexedIterAxesView<'a, T, B> ⓘ
pub fn indexed_axes_iter<I>(&self, axes: I) -> IndexedIterAxesView<'a, T, B> ⓘ
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>
impl<'a, R, T, B, D> TensorAny<R, T, B, D>
pub fn indexed_axes_iter_mut_with_order_f<I>( &'a mut self, axes: I, order: TensorIterOrder, ) -> Result<IndexedIterAxesMut<'a, T, B>>
pub fn indexed_axes_iter_mut_f<I>( &'a mut self, axes: I, ) -> Result<IndexedIterAxesMut<'a, T, B>>
pub fn indexed_axes_iter_mut_with_order<I>( &'a mut self, axes: I, order: TensorIterOrder, ) -> IndexedIterAxesMut<'a, T, B> ⓘ
pub fn indexed_axes_iter_mut<I>( &'a mut self, axes: I, ) -> IndexedIterAxesMut<'a, T, B> ⓘ
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>
impl<'a, R, T, B, D> TensorAny<R, T, B, D>
pub fn iter_with_order_f( &self, order: TensorIterOrder, ) -> Result<IterVecView<'a, T, D>>
pub fn iter_with_order(&self, order: TensorIterOrder) -> IterVecView<'a, T, D> ⓘ
pub fn iter_f(&self) -> Result<IterVecView<'a, T, D>>
pub fn iter(&self) -> IterVecView<'a, T, D> ⓘ
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>
impl<'a, R, T, B, D> TensorAny<R, T, B, D>
pub fn iter_mut_with_order_f( &'a mut self, order: TensorIterOrder, ) -> Result<IterVecMut<'a, T, D>>
pub fn iter_mut_with_order( &'a mut self, order: TensorIterOrder, ) -> IterVecMut<'a, T, D> ⓘ
pub fn iter_mut_f(&'a mut self) -> Result<IterVecMut<'a, T, D>>
pub fn iter_mut(&'a mut self) -> IterVecMut<'a, T, D> ⓘ
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>
impl<'a, R, T, B, D> TensorAny<R, T, B, D>
pub fn indexed_iter_with_order_f( &self, order: TensorIterOrder, ) -> Result<IndexedIterVecView<'a, T, D>>
pub fn indexed_iter_with_order( &self, order: TensorIterOrder, ) -> IndexedIterVecView<'a, T, D> ⓘ
pub fn indexed_iter_f(&self) -> Result<IndexedIterVecView<'a, T, D>>
pub fn indexed_iter(&self) -> IndexedIterVecView<'a, T, D> ⓘ
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>
impl<'a, R, T, B, D> TensorAny<R, T, B, D>
pub fn indexed_iter_mut_with_order_f( &'a mut self, order: TensorIterOrder, ) -> Result<IndexedIterVecMut<'a, T, D>>
pub fn indexed_iter_mut_with_order( &'a mut self, order: TensorIterOrder, ) -> IndexedIterVecMut<'a, T, D> ⓘ
pub fn indexed_iter_mut_f(&'a mut self) -> Result<IndexedIterVecMut<'a, T, D>>
pub fn indexed_iter_mut(&'a mut self) -> IndexedIterVecMut<'a, T, D> ⓘ
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn to_broadcast<D2>(&self, shape: D2) -> TensorView<'_, T, B, D2>where
D2: DimAPI,
D: DimMaxAPI<D2, Max = D2>,
pub fn to_broadcast<D2>(&self, shape: D2) -> TensorView<'_, T, B, D2>where
D2: DimAPI,
D: DimMaxAPI<D2, Max = D2>,
pub fn to_broadcast_f<D2>(&self, shape: D2) -> Result<TensorView<'_, T, B, D2>>where
D2: DimAPI,
D: DimMaxAPI<D2, Max = D2>,
Sourcepub fn into_broadcast<D2>(self, shape: D2) -> TensorAny<R, T, B, D2>where
D2: DimAPI,
D: DimMaxAPI<D2, Max = D2>,
pub fn into_broadcast<D2>(self, shape: D2) -> TensorAny<R, T, B, D2>where
D2: DimAPI,
D: DimMaxAPI<D2, Max = D2>,
pub fn into_broadcast_f<D2>(self, shape: D2) -> Result<TensorAny<R, T, B, D2>>where
D2: DimAPI,
D: DimMaxAPI<D2, Max = D2>,
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn expand_dims<I>(&self, axes: I) -> TensorView<'_, T, B, IxD>
pub fn expand_dims<I>(&self, axes: I) -> TensorView<'_, T, B, IxD>
Expands the shape of an array by inserting a new axis (dimension) of
size one at the position specified by axis
.
§See also
pub fn expand_dims_f<I>(&self, axes: I) -> Result<TensorView<'_, T, B, IxD>>
Sourcepub fn into_expand_dims<I>(self, axes: I) -> TensorAny<R, T, B, IxD>
pub fn into_expand_dims<I>(self, axes: I) -> TensorAny<R, T, B, IxD>
Expands the shape of an array by inserting a new axis (dimension) of
size one at the position specified by axis
.
§See also
pub fn into_expand_dims_f<I>(self, axes: I) -> Result<TensorAny<R, T, B, IxD>>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn flip<I>(&self, axis: I) -> TensorView<'_, T, B, D>
pub fn flip<I>(&self, axis: I) -> TensorView<'_, T, B, D>
pub fn flip_f<I>(&self, axis: I) -> Result<TensorView<'_, T, B, D>>
pub fn into_flip_f<I>(self, axis: I) -> Result<TensorAny<R, T, B, D>>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn transpose<I>(&self, axes: I) -> TensorView<'_, T, B, D>
pub fn transpose<I>(&self, axes: I) -> TensorView<'_, T, B, D>
pub fn transpose_f<I>(&self, axes: I) -> Result<TensorView<'_, T, B, D>>
Sourcepub fn into_transpose<I>(self, axes: I) -> TensorAny<R, T, B, D>
pub fn into_transpose<I>(self, axes: I) -> TensorAny<R, T, B, D>
pub fn into_transpose_f<I>(self, axes: I) -> Result<TensorAny<R, T, B, D>>
Sourcepub fn permute_dims<I>(&self, axes: I) -> TensorView<'_, T, B, D>
pub fn permute_dims<I>(&self, axes: I) -> TensorView<'_, T, B, D>
pub fn permute_dims_f<I>(&self, axes: I) -> Result<TensorView<'_, T, B, D>>
Sourcepub fn into_permute_dims<I>(self, axes: I) -> TensorAny<R, T, B, D>
pub fn into_permute_dims<I>(self, axes: I) -> TensorAny<R, T, B, D>
pub fn into_permute_dims_f<I>(self, axes: I) -> Result<TensorAny<R, T, B, D>>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn reverse_axes(&self) -> TensorView<'_, T, B, D>
pub fn reverse_axes(&self) -> TensorView<'_, T, B, D>
Sourcepub fn into_reverse_axes(self) -> TensorAny<R, T, B, D>
pub fn into_reverse_axes(self) -> TensorAny<R, T, B, D>
Sourcepub fn t(&self) -> TensorView<'_, T, B, D>
pub fn t(&self) -> TensorView<'_, T, B, D>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn swapaxes<I>(&self, axis1: I, axis2: I) -> TensorView<'_, T, B, D>
pub fn swapaxes<I>(&self, axis1: I, axis2: I) -> TensorView<'_, T, B, D>
pub fn swapaxes_f<I>( &self, axis1: I, axis2: I, ) -> Result<TensorView<'_, T, B, D>>
Sourcepub fn into_swapaxes<I>(self, axis1: I, axis2: I) -> TensorAny<R, T, B, D>
pub fn into_swapaxes<I>(self, axis1: I, axis2: I) -> TensorAny<R, T, B, D>
pub fn into_swapaxes_f<I>( self, axis1: I, axis2: I, ) -> Result<TensorAny<R, T, B, D>>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn squeeze<I>(&self, axis: I) -> TensorView<'_, T, B, IxD>
pub fn squeeze<I>(&self, axis: I) -> TensorView<'_, T, B, IxD>
pub fn squeeze_f<I>(&self, axis: I) -> Result<TensorView<'_, T, B, IxD>>
Sourcepub fn into_squeeze<I>(self, axis: I) -> TensorAny<R, T, B, IxD>
pub fn into_squeeze<I>(self, axis: I) -> TensorAny<R, T, B, IxD>
pub fn into_squeeze_f<I>(self, axis: I) -> Result<TensorAny<R, T, B, IxD>>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn to_dim<D2>(&self) -> TensorView<'_, T, B, D2>where
D2: DimAPI,
D: DimIntoAPI<D2>,
pub fn to_dim<D2>(&self) -> TensorView<'_, T, B, D2>where
D2: DimAPI,
D: DimIntoAPI<D2>,
pub fn to_dim_f<D2>(&self) -> Result<TensorView<'_, T, B, D2>>where
D2: DimAPI,
D: DimIntoAPI<D2>,
Sourcepub fn into_dim<D2>(self) -> TensorAny<R, T, B, D2>where
D2: DimAPI,
D: DimIntoAPI<D2>,
pub fn into_dim<D2>(self) -> TensorAny<R, T, B, D2>where
D2: DimAPI,
D: DimIntoAPI<D2>,
pub fn into_dim_f<D2>(self) -> Result<TensorAny<R, T, B, D2>>where
D2: DimAPI,
D: DimIntoAPI<D2>,
Sourcepub fn to_dyn(&self) -> TensorView<'_, T, B, IxD>
pub fn to_dyn(&self) -> TensorView<'_, T, B, IxD>
Convert layout to dynamic dimension.
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn reshape_assume_contig<D2>(&self, shape: D2) -> TensorView<'_, T, B, D2>where
D2: DimAPI,
pub fn reshape_assume_contig<D2>(&self, shape: D2) -> TensorView<'_, T, B, D2>where
D2: DimAPI,
Assuming contiguous array, reshapes an array without changing its data.
§See also
pub fn reshape_assume_contig_f<D2>(
&self,
shape: D2,
) -> Result<TensorView<'_, T, B, D2>>where
D2: DimAPI,
pub fn to_shape_assume_contig<D2>(&self, shape: D2) -> TensorView<'_, T, B, D2>where
D2: DimAPI,
pub fn to_shape_assume_contig_f<D2>(
&self,
shape: D2,
) -> Result<TensorView<'_, T, B, D2>>where
D2: DimAPI,
pub fn into_shape_assume_contig<D2>(self, shape: D2) -> TensorAny<R, T, B, D2>where
D2: DimAPI,
pub fn into_shape_assume_contig_f<D2>(
self,
shape: D2,
) -> Result<TensorAny<R, T, B, D2>>where
D2: DimAPI,
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw> + DataIntoCowAPI<'a>,
D: DimAPI,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignArbitaryAPI<T, IxD, D> + OpAssignAPI<T, IxD>,
T: Clone,
impl<'a, R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw> + DataIntoCowAPI<'a>,
D: DimAPI,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignArbitaryAPI<T, IxD, D> + OpAssignAPI<T, IxD>,
T: Clone,
pub fn change_shape_f<I>(self, shape: I) -> Result<TensorCow<'a, T, B, IxD>>
pub fn change_shape<I>(self, shape: I) -> TensorCow<'a, T, B, IxD>
pub fn into_shape_f<I>(self, shape: I) -> Result<Tensor<T, B, IxD>>
pub fn into_shape<I>(self, shape: I) -> Tensor<T, B, IxD>
pub fn to_shape_f<I>(&'a self, shape: I) -> Result<TensorCow<'a, T, B, IxD>>
pub fn to_shape<I>(&'a self, shape: I) -> TensorCow<'a, T, B, IxD>
pub fn reshape_f<I>(&'a self, shape: I) -> Result<TensorCow<'a, T, B, IxD>>
pub fn reshape<I>(&'a self, shape: I) -> TensorCow<'a, T, B, IxD>
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw> + DataIntoCowAPI<'a>,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T>,
impl<'a, R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw> + DataIntoCowAPI<'a>,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T>,
Sourcepub fn to_layout<D2>(&self, layout: Layout<D2>) -> TensorCow<'_, T, B, D2>where
D2: DimAPI,
B: OpAssignArbitaryAPI<T, D2, D>,
pub fn to_layout<D2>(&self, layout: Layout<D2>) -> TensorCow<'_, T, B, D2>where
D2: DimAPI,
B: OpAssignArbitaryAPI<T, D2, D>,
pub fn to_layout_f<D2>(
&self,
layout: Layout<D2>,
) -> Result<TensorCow<'_, T, B, D2>>where
D2: DimAPI,
B: OpAssignArbitaryAPI<T, D2, D>,
pub fn into_layout_f<D2>(self, layout: Layout<D2>) -> Result<Tensor<T, B, D2>>
pub fn into_layout<D2>(self, layout: Layout<D2>) -> Tensor<T, B, D2>
pub fn change_layout_f<D2>(
self,
layout: Layout<D2>,
) -> Result<TensorCow<'a, T, B, D2>>where
D2: DimAPI,
B: OpAssignArbitaryAPI<T, D2, D>,
pub fn change_layout<D2>(self, layout: Layout<D2>) -> TensorCow<'a, T, B, D2>where
D2: DimAPI,
B: OpAssignArbitaryAPI<T, D2, D>,
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw> + DataIntoCowAPI<'a>,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T>,
impl<'a, R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw> + DataIntoCowAPI<'a>,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T>,
Sourcepub fn to_contig(&self, order: FlagOrder) -> TensorCow<'_, T, B, D>where
B: OpAssignArbitaryAPI<T, D, D>,
pub fn to_contig(&self, order: FlagOrder) -> TensorCow<'_, T, B, D>where
B: OpAssignArbitaryAPI<T, D, D>,
Convert tensor to contiguous, with specified layout.
pub fn to_contig_f(&self, order: FlagOrder) -> Result<TensorCow<'_, T, B, D>>where
B: OpAssignArbitaryAPI<T, D, D>,
pub fn into_contig_f(self, order: FlagOrder) -> Result<Tensor<T, B, D>>
pub fn into_contig(self, order: FlagOrder) -> Tensor<T, B, D>
pub fn change_contig_f(self, order: FlagOrder) -> Result<TensorCow<'a, T, B, D>>where
B: OpAssignArbitaryAPI<T, D, D>,
pub fn change_contig(self, order: FlagOrder) -> TensorCow<'a, T, B, D>where
B: OpAssignArbitaryAPI<T, D, D>,
Source§impl<'a, R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw> + DataIntoCowAPI<'a>,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T>,
impl<'a, R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw> + DataIntoCowAPI<'a>,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T>,
Sourcepub fn to_prefer(&self, order: FlagOrder) -> TensorCow<'_, T, B, D>where
B: OpAssignArbitaryAPI<T, D, D>,
pub fn to_prefer(&self, order: FlagOrder) -> TensorCow<'_, T, B, D>where
B: OpAssignArbitaryAPI<T, D, D>,
Convert tensor to contiguous, with specified layout.
pub fn to_prefer_f(&self, order: FlagOrder) -> Result<TensorCow<'_, T, B, D>>where
B: OpAssignArbitaryAPI<T, D, D>,
pub fn into_prefer_f(self, order: FlagOrder) -> Result<Tensor<T, B, D>>
pub fn into_prefer(self, order: FlagOrder) -> Tensor<T, B, D>
pub fn change_prefer_f(self, order: FlagOrder) -> Result<TensorCow<'a, T, B, D>>where
B: OpAssignArbitaryAPI<T, D, D>,
pub fn change_prefer(self, order: FlagOrder) -> TensorCow<'a, T, B, D>where
B: OpAssignArbitaryAPI<T, D, D>,
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn map_fnmut_f<'f, TOut>(
&self,
f: impl FnMut(&T) -> TOut + 'f,
) -> Result<Tensor<TOut, B, D>>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn FnMut(&mut TOut, &T) + 'f>,
pub fn map_fnmut_f<'f, TOut>(
&self,
f: impl FnMut(&T) -> TOut + 'f,
) -> Result<Tensor<TOut, B, D>>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn FnMut(&mut TOut, &T) + 'f>,
Call f
by reference on each element and create a new tensor with the
new values.
Sourcepub fn map_fnmut<'f, TOut>(
&self,
f: impl FnMut(&T) -> TOut + 'f,
) -> Tensor<TOut, B, D>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn FnMut(&mut TOut, &T) + 'f>,
pub fn map_fnmut<'f, TOut>(
&self,
f: impl FnMut(&T) -> TOut + 'f,
) -> Tensor<TOut, B, D>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn FnMut(&mut TOut, &T) + 'f>,
Call f
by reference on each element and create a new tensor with the
new values.
Sourcepub fn mapv_fnmut_f<'f, TOut>(
&self,
f: impl FnMut(T) -> TOut + 'f,
) -> Result<Tensor<TOut, B, D>>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn FnMut(&mut TOut, &T) + 'f>,
T: Clone,
pub fn mapv_fnmut_f<'f, TOut>(
&self,
f: impl FnMut(T) -> TOut + 'f,
) -> Result<Tensor<TOut, B, D>>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn FnMut(&mut TOut, &T) + 'f>,
T: Clone,
Call f
by value on each element and create a new tensor with the new
values.
Sourcepub fn mapv_fnmut<'f, TOut>(
&self,
f: impl FnMut(T) -> TOut + 'f,
) -> Tensor<TOut, B, D>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn FnMut(&mut TOut, &T) + 'f>,
T: Clone,
pub fn mapv_fnmut<'f, TOut>(
&self,
f: impl FnMut(T) -> TOut + 'f,
) -> Tensor<TOut, B, D>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn FnMut(&mut TOut, &T) + 'f>,
T: Clone,
Call f
by value on each element and create a new tensor with the new
values.
Sourcepub fn mapi_fnmut_f<'f>(&mut self, f: impl FnMut(&mut T) + 'f) -> Result<()>
pub fn mapi_fnmut_f<'f>(&mut self, f: impl FnMut(&mut T) + 'f) -> Result<()>
Modify the tensor in place by calling f
by mutable reference on each
element.
Sourcepub fn mapi_fnmut<'f>(&mut self, f: impl FnMut(&mut T) + 'f)
pub fn mapi_fnmut<'f>(&mut self, f: impl FnMut(&mut T) + 'f)
Modify the tensor in place by calling f
by mutable reference on each
element.
Sourcepub fn mapvi_fnmut_f<'f>(&mut self, f: impl FnMut(T) -> T + 'f) -> Result<()>
pub fn mapvi_fnmut_f<'f>(&mut self, f: impl FnMut(T) -> T + 'f) -> Result<()>
Modify the tensor in place by calling f
by value on each
element.
Sourcepub fn mapvi_fnmut<'f>(&mut self, f: impl FnMut(T) -> T + 'f)
pub fn mapvi_fnmut<'f>(&mut self, f: impl FnMut(T) -> T + 'f)
Modify the tensor in place by calling f
by value on each
element.
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn mapb_fnmut_f<'f, R2, T2, D2, DOut, TOut>(
&self,
other: &TensorAny<R2, T2, B, D2>,
f: impl FnMut(&T, &T2) -> TOut + 'f,
) -> Result<Tensor<TOut, B, DOut>>where
R2: DataAPI<Data = <B as DeviceRawAPI<T2>>::Raw>,
D2: DimAPI,
DOut: DimAPI,
D: DimMaxAPI<D2, Max = DOut>,
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutC_RefA_RefB_API<T, T2, TOut, DOut, dyn FnMut(&mut TOut, &T, &T2) + 'f>,
pub fn mapb_fnmut<'f, R2, T2, D2, DOut, TOut>(
&self,
other: &TensorAny<R2, T2, B, D2>,
f: impl FnMut(&T, &T2) -> TOut + 'f,
) -> Tensor<TOut, B, DOut>where
R2: DataAPI<Data = <B as DeviceRawAPI<T2>>::Raw>,
D2: DimAPI,
DOut: DimAPI,
D: DimMaxAPI<D2, Max = DOut>,
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutC_RefA_RefB_API<T, T2, TOut, DOut, dyn FnMut(&mut TOut, &T, &T2) + 'f>,
pub fn mapvb_fnmut_f<'f, R2, T2, D2, DOut, TOut>(
&self,
other: &TensorAny<R2, T2, B, D2>,
f: impl FnMut(T, T2) -> TOut + 'f,
) -> Result<Tensor<TOut, B, DOut>>where
R2: DataAPI<Data = <B as DeviceRawAPI<T2>>::Raw>,
D2: DimAPI,
DOut: DimAPI,
D: DimMaxAPI<D2, Max = DOut>,
T: Clone,
T2: Clone,
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutC_RefA_RefB_API<T, T2, TOut, DOut, dyn FnMut(&mut TOut, &T, &T2) + 'f>,
pub fn mapvb_fnmut<'f, R2, T2, D2, DOut, TOut>(
&self,
other: &TensorAny<R2, T2, B, D2>,
f: impl FnMut(T, T2) -> TOut + 'f,
) -> Tensor<TOut, B, DOut>where
R2: DataAPI<Data = <B as DeviceRawAPI<T2>>::Raw>,
D2: DimAPI,
DOut: DimAPI,
D: DimMaxAPI<D2, Max = DOut>,
T: Clone,
T2: Clone,
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutC_RefA_RefB_API<T, T2, TOut, DOut, dyn FnMut(&mut TOut, &T, &T2) + 'f>,
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
Sourcepub fn map_f<'f, TOut>(
&self,
f: impl Fn(&T) -> TOut + Send + Sync + 'f,
) -> Result<Tensor<TOut, B, D>>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn Fn(&mut TOut, &T) + Send + Sync + 'f>,
pub fn map_f<'f, TOut>(
&self,
f: impl Fn(&T) -> TOut + Send + Sync + 'f,
) -> Result<Tensor<TOut, B, D>>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn Fn(&mut TOut, &T) + Send + Sync + 'f>,
Call f
by reference on each element and create a new tensor with the
new values.
Sourcepub fn map<'f, TOut>(
&self,
f: impl Fn(&T) -> TOut + Send + Sync + 'f,
) -> Tensor<TOut, B, D>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn Fn(&mut TOut, &T) + Send + Sync + 'f>,
pub fn map<'f, TOut>(
&self,
f: impl Fn(&T) -> TOut + Send + Sync + 'f,
) -> Tensor<TOut, B, D>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn Fn(&mut TOut, &T) + Send + Sync + 'f>,
Call f
by reference on each element and create a new tensor with the
new values.
Sourcepub fn mapv_f<'f, TOut>(
&self,
f: impl Fn(T) -> TOut + Send + Sync + 'f,
) -> Result<Tensor<TOut, B, D>>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn Fn(&mut TOut, &T) + Send + Sync + 'f>,
T: Clone,
pub fn mapv_f<'f, TOut>(
&self,
f: impl Fn(T) -> TOut + Send + Sync + 'f,
) -> Result<Tensor<TOut, B, D>>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn Fn(&mut TOut, &T) + Send + Sync + 'f>,
T: Clone,
Call f
by value on each element and create a new tensor with the new
values.
Sourcepub fn mapv<'f, TOut>(
&self,
f: impl Fn(T) -> TOut + Send + Sync + 'f,
) -> Tensor<TOut, B, D>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn Fn(&mut TOut, &T) + Send + Sync + 'f>,
T: Clone,
pub fn mapv<'f, TOut>(
&self,
f: impl Fn(T) -> TOut + Send + Sync + 'f,
) -> Tensor<TOut, B, D>where
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutA_RefB_API<TOut, T, D, dyn Fn(&mut TOut, &T) + Send + Sync + 'f>,
T: Clone,
Call f
by value on each element and create a new tensor with the new
values.
Sourcepub fn mapi_f<'f>(
&mut self,
f: impl Fn(&mut T) + Send + Sync + 'f,
) -> Result<()>
pub fn mapi_f<'f>( &mut self, f: impl Fn(&mut T) + Send + Sync + 'f, ) -> Result<()>
Modify the tensor in place by calling f
by mutable reference on each
element.
Sourcepub fn mapi<'f>(&mut self, f: impl Fn(&mut T) + Send + Sync + 'f)
pub fn mapi<'f>(&mut self, f: impl Fn(&mut T) + Send + Sync + 'f)
Modify the tensor in place by calling f
by mutable reference on each
element.
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn mapb_f<'f, R2, T2, D2, DOut, TOut>(
&self,
other: &TensorAny<R2, T2, B, D2>,
f: impl Fn(&T, &T2) -> TOut + Send + Sync + 'f,
) -> Result<Tensor<TOut, B, DOut>>where
R2: DataAPI<Data = <B as DeviceRawAPI<T2>>::Raw>,
D2: DimAPI,
DOut: DimAPI,
D: DimMaxAPI<D2, Max = DOut>,
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutC_RefA_RefB_API<T, T2, TOut, DOut, dyn Fn(&mut TOut, &T, &T2) + Send + Sync + 'f>,
pub fn mapb<'f, R2, T2, D2, DOut, TOut>(
&self,
other: &TensorAny<R2, T2, B, D2>,
f: impl Fn(&T, &T2) -> TOut + Send + Sync + 'f,
) -> Tensor<TOut, B, DOut>where
R2: DataAPI<Data = <B as DeviceRawAPI<T2>>::Raw>,
D2: DimAPI,
DOut: DimAPI,
D: DimMaxAPI<D2, Max = DOut>,
B: DeviceAPI<TOut> + DeviceCreationAnyAPI<TOut> + DeviceOp_MutC_RefA_RefB_API<T, T2, TOut, DOut, dyn Fn(&mut TOut, &T, &T2) + Send + Sync + 'f>,
pub fn mapvb_f<'f, R2, T2, D2, DOut, TOut>( &self, other: &TensorAny<R2, T2, B, D2>, f: impl Fn(T, T2) -> TOut + Send + Sync + 'f, ) -> Result<Tensor<TOut, B, DOut>>
pub fn mapvb<'f, R2, T2, D2, DOut, TOut>( &self, other: &TensorAny<R2, T2, B, D2>, f: impl Fn(T, T2) -> TOut + Send + Sync + 'f, ) -> Tensor<TOut, B, DOut>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn matmul_f<RB, TB, TC, DB, DC>(
&self,
rhs: &TensorAny<RB, TB, B, DB>,
) -> Result<Tensor<TC, B, DC>>where
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DB: DimAPI,
DC: DimAPI,
T: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<T, TB, TC, D, DB, DC>,
LayoutMatMulConfig<D, DB>: LayoutMatMulAPI<D, DB, DC = DC>,
pub fn matmul<RB, TB, TC, DB, DC>(
&self,
rhs: &TensorAny<RB, TB, B, DB>,
) -> Tensor<TC, B, DC>where
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DB: DimAPI,
DC: DimAPI,
T: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<T, TB, TC, D, DB, DC>,
LayoutMatMulConfig<D, DB>: LayoutMatMulAPI<D, DB, DC = DC>,
pub fn matmul_with_output_f<RB, RC, TB, TC, DB, DC>(
&self,
rhs: &TensorAny<RB, TB, B, DB>,
c: &mut TensorAny<RC, TC, B, DC>,
) -> Result<()>where
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
RC: DataMutAPI<Data = <B as DeviceRawAPI<TC>>::Raw>,
DB: DimAPI,
DC: DimAPI,
T: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TB> + DeviceAPI<TC> + DeviceMatMulAPI<T, TB, TC, D, DB, DC>,
pub fn matmul_with_output<RB, RC, TB, TC, DB, DC>(
&self,
rhs: &TensorAny<RB, TB, B, DB>,
c: &mut TensorAny<RC, TC, B, DC>,
)where
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
RC: DataMutAPI<Data = <B as DeviceRawAPI<TC>>::Raw>,
DB: DimAPI,
DC: DimAPI,
T: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TB> + DeviceAPI<TC> + DeviceMatMulAPI<T, TB, TC, D, DB, DC>,
pub fn matmul_from_f<RA, RB, TA, TB, DA, DB>(
&mut self,
a: &TensorAny<RA, TA, B, DA>,
b: &TensorAny<RB, TB, B, DB>,
alpha: T,
beta: T,
) -> Result<()>where
R: DataMutAPI<Data = <B as DeviceRawAPI<T>>::Raw>,
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
TA: Mul<TB, Output = T>,
T: Mul<T, Output = T> + Add<T, Output = T> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceMatMulAPI<TA, TB, T, DA, DB, D>,
pub fn matmul_from<RA, RB, TA, TB, DA, DB>(
&mut self,
a: &TensorAny<RA, TA, B, DA>,
b: &TensorAny<RB, TB, B, DB>,
alpha: T,
beta: T,
)where
R: DataMutAPI<Data = <B as DeviceRawAPI<T>>::Raw>,
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
TA: Mul<TB, Output = T>,
T: Mul<T, Output = T> + Add<T, Output = T> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceMatMulAPI<TA, TB, T, DA, DB, D>,
Source§impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
D: DimAPI + DimSmallerOneAPI,
D::SmallerOne: DimAPI,
B: DeviceAPI<T> + DeviceOpPackTriAPI<T> + DeviceCreationAnyAPI<T>,
impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
D: DimAPI + DimSmallerOneAPI,
D::SmallerOne: DimAPI,
B: DeviceAPI<T> + DeviceOpPackTriAPI<T> + DeviceCreationAnyAPI<T>,
pub fn pack_tri_f(&self, uplo: FlagUpLo) -> Result<Tensor<T, B, D::SmallerOne>>
pub fn pack_tri(&self, uplo: FlagUpLo) -> Tensor<T, B, D::SmallerOne>
pub fn pack_tril_f(&self) -> Result<Tensor<T, B, D::SmallerOne>>
pub fn pack_tril(&self) -> Tensor<T, B, D::SmallerOne>
pub fn pack_triu_f(&self) -> Result<Tensor<T, B, D::SmallerOne>>
pub fn pack_triu(&self) -> Tensor<T, B, D::SmallerOne>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
D: DimAPI + DimLargerOneAPI,
D::LargerOne: DimAPI,
B: DeviceAPI<T> + DeviceOpUnpackTriAPI<T> + DeviceCreationAnyAPI<T>,
impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
D: DimAPI + DimLargerOneAPI,
D::LargerOne: DimAPI,
B: DeviceAPI<T> + DeviceOpUnpackTriAPI<T> + DeviceCreationAnyAPI<T>,
pub fn unpack_tri( &self, uplo: FlagUpLo, symm: FlagSymm, ) -> Result<Tensor<T, B, D::LargerOne>>
pub fn unpack_tril(&self, symm: FlagSymm) -> Tensor<T, B, D::LargerOne>
pub fn unpack_triu(&self, symm: FlagSymm) -> Tensor<T, B, D::LargerOne>
pub fn unpack_tri_f( &self, uplo: FlagUpLo, symm: FlagSymm, ) -> Result<Tensor<T, B, D::LargerOne>>
pub fn unpack_tril_f( &self, symm: FlagSymm, ) -> Result<Tensor<T, B, D::LargerOne>>
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
Methods for tensor ownership conversion.
impl<R, T, B, D> TensorAny<R, T, B, D>
Methods for tensor ownership conversion.
Sourcepub fn view(&self) -> TensorView<'_, T, B, D>
pub fn view(&self) -> TensorView<'_, T, B, D>
Get a view of tensor.
Sourcepub fn view_mut(&mut self) -> TensorMut<'_, T, B, D>where
R: DataMutAPI,
pub fn view_mut(&mut self) -> TensorMut<'_, T, B, D>where
R: DataMutAPI,
Get a mutable view of tensor.
Sourcepub fn into_cow<'a>(self) -> TensorCow<'a, T, B, D>where
R: DataIntoCowAPI<'a>,
pub fn into_cow<'a>(self) -> TensorCow<'a, T, B, D>where
R: DataIntoCowAPI<'a>,
Convert current tensor into copy-on-write.
Sourcepub fn into_owned_keep_layout(self) -> Tensor<T, B, D>
pub fn into_owned_keep_layout(self) -> Tensor<T, B, D>
Convert tensor into owned tensor.
Data is either moved or fully cloned. Layout is not involved; i.e. all underlying data is moved or cloned without changing layout.
§See also
Tensor::into_owned
keep data in some conditions, otherwise clone.
This function can avoid cases where data memory bulk is large, but
tensor view is small.
Convert tensor into shared tensor.
Data is either moved or cloned. Layout is not involved; i.e. all underlying data is moved or cloned without changing layout.
§See also
Tensor::into_shared
keep data in some conditions, otherwise clone.
This function can avoid cases where data memory bulk is large, but
tensor view is small.
Source§impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataCloneAPI<Data = B::Raw>,
R::Data: Clone,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, D>,
impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataCloneAPI<Data = B::Raw>,
R::Data: Clone,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, D>,
Source§impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
T: Clone,
D: DimAPI,
B: DeviceAPI<T, Raw = Vec<T>> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, Ix1>,
impl<R, T, B, D> TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
T: Clone,
D: DimAPI,
B: DeviceAPI<T, Raw = Vec<T>> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, Ix1>,
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn to_scalar_f(&self) -> Result<T>
pub fn to_scalar(&self) -> T
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn as_ptr(&self) -> *const T
pub fn as_mut_ptr(&mut self) -> *mut Twhere
R: DataMutAPI,
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn sum_all_f(&self) -> Result<B::TOut>
pub fn sum_all(&self) -> B::TOut
pub fn sum_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn sum_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn sum_f(&self) -> Result<B::TOut>
pub fn sum(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn min_all_f(&self) -> Result<B::TOut>
pub fn min_all(&self) -> B::TOut
pub fn min_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn min_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn min_f(&self) -> Result<B::TOut>
pub fn min(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn max_all_f(&self) -> Result<B::TOut>
pub fn max_all(&self) -> B::TOut
pub fn max_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn max_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn max_f(&self) -> Result<B::TOut>
pub fn max(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn prod_all_f(&self) -> Result<B::TOut>
pub fn prod_all(&self) -> B::TOut
pub fn prod_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn prod_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn prod_f(&self) -> Result<B::TOut>
pub fn prod(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn mean_all_f(&self) -> Result<B::TOut>
pub fn mean_all(&self) -> B::TOut
pub fn mean_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn mean_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn mean_f(&self) -> Result<B::TOut>
pub fn mean(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn var_all_f(&self) -> Result<B::TOut>
pub fn var_all(&self) -> B::TOut
pub fn var_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn var_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn var_f(&self) -> Result<B::TOut>
pub fn var(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn std_all_f(&self) -> Result<B::TOut>
pub fn std_all(&self) -> B::TOut
pub fn std_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn std_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn std_f(&self) -> Result<B::TOut>
pub fn std(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn l2_norm_all_f(&self) -> Result<B::TOut>
pub fn l2_norm_all(&self) -> B::TOut
pub fn l2_norm_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn l2_norm_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn l2_norm_f(&self) -> Result<B::TOut>
pub fn l2_norm(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn argmin_all_f(&self) -> Result<B::TOut>
pub fn argmin_all(&self) -> B::TOut
pub fn argmin_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn argmin_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn argmin_f(&self) -> Result<B::TOut>
pub fn argmin(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn argmax_all_f(&self) -> Result<B::TOut>
pub fn argmax_all(&self) -> B::TOut
pub fn argmax_axes_f<I>(&self, axes: I) -> Result<Tensor<B::TOut, B, IxD>>
pub fn argmax_axes<I>(&self, axes: I) -> Tensor<B::TOut, B, IxD>
pub fn argmax_f(&self) -> Result<B::TOut>
pub fn argmax(&self) -> B::TOut
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn unraveled_argmin_all_f(&self) -> Result<D>
pub fn unraveled_argmin_all(&self) -> D
pub fn unraveled_argmin_axes_f<I>(&self, axes: I) -> Result<Tensor<IxD, B, IxD>>
pub fn unraveled_argmin_axes<I>(&self, axes: I) -> Tensor<IxD, B, IxD>
pub fn unraveled_argmin_f(&self) -> Result<D>
pub fn unraveled_argmin(&self) -> D
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn unraveled_argmax_all_f(&self) -> Result<D>
pub fn unraveled_argmax_all(&self) -> D
pub fn unraveled_argmax_axes_f<I>(&self, axes: I) -> Result<Tensor<IxD, B, IxD>>
pub fn unraveled_argmax_axes<I>(&self, axes: I) -> Tensor<IxD, B, IxD>
pub fn unraveled_argmax_f(&self) -> Result<D>
pub fn unraveled_argmax(&self) -> D
Source§impl<R, T, B, D> TensorAny<R, T, B, D>
impl<R, T, B, D> TensorAny<R, T, B, D>
pub fn new_f(storage: Storage<R, T, B>, layout: Layout<D>) -> Result<Self>
pub fn new(storage: Storage<R, T, B>, layout: Layout<D>) -> Self
pub fn device(&self) -> &B
pub fn data(&self) -> &R
pub fn data_mut(&mut self) -> &mut R
pub fn raw(&self) -> &B::Raw
pub fn raw_mut(&mut self) -> &mut B::Rawwhere
R: DataMutAPI<Data = B::Raw>,
Trait Implementations§
Source§impl<TRB, RA, TA, DA, B> AddAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorAddAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> AddAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorAddAssignAPI<TRB>,
Source§fn add_assign(&mut self, b: TRB)
fn add_assign(&mut self, b: TRB)
+=
operation. Read moreSource§impl<R, T, B, D> AsArrayAPI<()> for &TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
T: Clone,
D: DimAPI,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, D>,
impl<R, T, B, D> AsArrayAPI<()> for &TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
T: Clone,
D: DimAPI,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, D>,
Source§impl<TRB, RA, TA, DA, B> BitAndAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorBitAndAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> BitAndAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorBitAndAssignAPI<TRB>,
Source§fn bitand_assign(&mut self, b: TRB)
fn bitand_assign(&mut self, b: TRB)
&=
operation. Read moreSource§impl<TRB, RA, TA, DA, B> BitOrAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorBitOrAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> BitOrAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorBitOrAssignAPI<TRB>,
Source§fn bitor_assign(&mut self, b: TRB)
fn bitor_assign(&mut self, b: TRB)
|=
operation. Read moreSource§impl<TRB, RA, TA, DA, B> BitXorAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorBitXorAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> BitXorAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorBitXorAssignAPI<TRB>,
Source§fn bitxor_assign(&mut self, b: TRB)
fn bitxor_assign(&mut self, b: TRB)
^=
operation. Read moreSource§impl<R, T, B, D> DiagAPI<()> for &TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
T: Clone + Default,
D: DimAPI,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, Ix1>,
impl<R, T, B, D> DiagAPI<()> for &TensorAny<R, T, B, D>where
R: DataAPI<Data = B::Raw>,
T: Clone + Default,
D: DimAPI,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, Ix1>,
Source§impl<TRB, RA, TA, DA, B> DivAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorDivAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> DivAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorDivAssignAPI<TRB>,
Source§fn div_assign(&mut self, b: TRB)
fn div_assign(&mut self, b: TRB)
/=
operation. Read moreSource§impl<R, T, B, D> EmptyLikeAPI<()> for &TensorAny<R, T, B, D>
impl<R, T, B, D> EmptyLikeAPI<()> for &TensorAny<R, T, B, D>
type Out = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<T>>::Raw>, T, B>, D>
Source§impl<TRB, RA, TA, DA, B> MulAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorMulAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> MulAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorMulAssignAPI<TRB>,
Source§fn mul_assign(&mut self, b: TRB)
fn mul_assign(&mut self, b: TRB)
*=
operation. Read moreSource§impl<R, T, B, D> OnesLikeAPI<()> for &TensorAny<R, T, B, D>
impl<R, T, B, D> OnesLikeAPI<()> for &TensorAny<R, T, B, D>
Source§impl<RA, RB, TA, TB, TC, DA, DB, DC, B> Rem<&TensorBase<Storage<RB, TB, B>, DB>> for &TensorAny<RA, TA, B, DA>where
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
DC: DimAPI,
TA: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<TA, TB, TC, DA, DB, DC>,
LayoutMatMulConfig<DA, DB>: LayoutMatMulAPI<DA, DB, DC = DC>,
impl<RA, RB, TA, TB, TC, DA, DB, DC, B> Rem<&TensorBase<Storage<RB, TB, B>, DB>> for &TensorAny<RA, TA, B, DA>where
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
DC: DimAPI,
TA: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<TA, TB, TC, DA, DB, DC>,
LayoutMatMulConfig<DA, DB>: LayoutMatMulAPI<DA, DB, DC = DC>,
Source§impl<RA, RB, TA, TB, TC, DA, DB, DC, B> Rem<&TensorBase<Storage<RB, TB, B>, DB>> for TensorAny<RA, TA, B, DA>where
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
DC: DimAPI,
TA: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<TA, TB, TC, DA, DB, DC>,
LayoutMatMulConfig<DA, DB>: LayoutMatMulAPI<DA, DB, DC = DC>,
impl<RA, RB, TA, TB, TC, DA, DB, DC, B> Rem<&TensorBase<Storage<RB, TB, B>, DB>> for TensorAny<RA, TA, B, DA>where
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
DC: DimAPI,
TA: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<TA, TB, TC, DA, DB, DC>,
LayoutMatMulConfig<DA, DB>: LayoutMatMulAPI<DA, DB, DC = DC>,
Source§impl<RA, RB, TA, TB, TC, DA, DB, DC, B> Rem<TensorBase<Storage<RB, TB, B>, DB>> for &TensorAny<RA, TA, B, DA>where
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
DC: DimAPI,
TA: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<TA, TB, TC, DA, DB, DC>,
LayoutMatMulConfig<DA, DB>: LayoutMatMulAPI<DA, DB, DC = DC>,
impl<RA, RB, TA, TB, TC, DA, DB, DC, B> Rem<TensorBase<Storage<RB, TB, B>, DB>> for &TensorAny<RA, TA, B, DA>where
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
DC: DimAPI,
TA: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<TA, TB, TC, DA, DB, DC>,
LayoutMatMulConfig<DA, DB>: LayoutMatMulAPI<DA, DB, DC = DC>,
Source§impl<RA, RB, TA, TB, TC, DA, DB, DC, B> Rem<TensorBase<Storage<RB, TB, B>, DB>> for TensorAny<RA, TA, B, DA>where
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
DC: DimAPI,
TA: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<TA, TB, TC, DA, DB, DC>,
LayoutMatMulConfig<DA, DB>: LayoutMatMulAPI<DA, DB, DC = DC>,
impl<RA, RB, TA, TB, TC, DA, DB, DC, B> Rem<TensorBase<Storage<RB, TB, B>, DB>> for TensorAny<RA, TA, B, DA>where
RA: DataAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
RB: DataAPI<Data = <B as DeviceRawAPI<TB>>::Raw>,
DA: DimAPI,
DB: DimAPI,
DC: DimAPI,
TA: Mul<TB, Output = TC>,
TC: Mul<TC, Output = TC> + Add<TC, Output = TC> + Zero + One,
B: DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<TC> + DeviceCreationAnyAPI<TC> + DeviceMatMulAPI<TA, TB, TC, DA, DB, DC>,
LayoutMatMulConfig<DA, DB>: LayoutMatMulAPI<DA, DB, DC = DC>,
Source§impl<TRB, RA, TA, DA, B> RemAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorRemAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> RemAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorRemAssignAPI<TRB>,
Source§fn rem_assign(&mut self, b: TRB)
fn rem_assign(&mut self, b: TRB)
%=
operation. Read moreSource§impl<TRB, RA, TA, DA, B> ShlAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorShlAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> ShlAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorShlAssignAPI<TRB>,
Source§fn shl_assign(&mut self, b: TRB)
fn shl_assign(&mut self, b: TRB)
<<=
operation. Read moreSource§impl<TRB, RA, TA, DA, B> ShrAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorShrAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> ShrAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorShrAssignAPI<TRB>,
Source§fn shr_assign(&mut self, b: TRB)
fn shr_assign(&mut self, b: TRB)
>>=
operation. Read moreSource§impl<TRB, RA, TA, DA, B> SubAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorSubAssignAPI<TRB>,
impl<TRB, RA, TA, DA, B> SubAssign<TRB> for TensorAny<RA, TA, B, DA>where
RA: DataMutAPI<Data = <B as DeviceRawAPI<TA>>::Raw>,
DA: DimAPI,
B: DeviceAPI<TA>,
for<'a> &'a mut Self: TensorSubAssignAPI<TRB>,
Source§fn sub_assign(&mut self, b: TRB)
fn sub_assign(&mut self, b: TRB)
-=
operation. Read more