pub struct TensorBase<S, D>where
D: DimAPI,{ /* private fields */ }
Implementations§
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn assign_f<TRB>(&mut self, b: TRB) -> Result<()>where
Self: TensorAssignAPI<TRB>,
pub fn assign<TRB>(&mut self, b: TRB)where
Self: TensorAssignAPI<TRB>,
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
pub fn into_slice_mut_f<I>(self, index: I) -> Result<TensorAny<R, T, B, IxD>>
pub fn into_slice_mut<I>(self, index: I) -> TensorAny<R, T, B, IxD>
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<T, B, D> TensorBase<Storage<DataOwned<<B as DeviceRawAPI<T>>::Raw>, T, B>, D>
impl<T, B, D> TensorBase<Storage<DataOwned<<B as DeviceRawAPI<T>>::Raw>, T, B>, D>
Source§impl<T, B, D> TensorBase<Storage<DataRef<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
impl<T, B, D> TensorBase<Storage<DataRef<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
Source§impl<T, B, D> TensorBase<Storage<DataMut<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
impl<T, B, D> TensorBase<Storage<DataMut<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
Source§impl<T, B, D> TensorBase<Storage<DataCow<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
impl<T, B, D> TensorBase<Storage<DataCow<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
Source§impl<T, B, D> TensorBase<Storage<DataOwned<<B as DeviceRawAPI<T>>::Raw>, T, B>, D>
impl<T, B, D> TensorBase<Storage<DataOwned<<B as DeviceRawAPI<T>>::Raw>, T, B>, D>
Source§impl<T, B, D> TensorBase<Storage<DataMut<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
impl<T, B, D> TensorBase<Storage<DataMut<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
Source§impl<'a, R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<'a, R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<'a, R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<'a, R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<'a, R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<'a, R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<'a, R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<'a, R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<'a, R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<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> TensorBase<Storage<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> TensorBase<Storage<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> TensorBase<Storage<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<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn add_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorAddAPI<TRB>>::Output>where
for<'a> &'a Self: TensorAddAPI<TRB>,
pub fn add<TRB>(&self, b: TRB) -> <&Self as TensorAddAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorAddAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn sub_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorSubAPI<TRB>>::Output>where
for<'a> &'a Self: TensorSubAPI<TRB>,
pub fn sub<TRB>(&self, b: TRB) -> <&Self as TensorSubAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorSubAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn mul_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorMulAPI<TRB>>::Output>where
for<'a> &'a Self: TensorMulAPI<TRB>,
pub fn mul<TRB>(&self, b: TRB) -> <&Self as TensorMulAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorMulAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn div_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorDivAPI<TRB>>::Output>where
for<'a> &'a Self: TensorDivAPI<TRB>,
pub fn div<TRB>(&self, b: TRB) -> <&Self as TensorDivAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorDivAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn rem_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorRemAPI<TRB>>::Output>where
for<'a> &'a Self: TensorRemAPI<TRB>,
pub fn rem<TRB>(&self, b: TRB) -> <&Self as TensorRemAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorRemAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn bitor_f<TRB>(
&self,
b: TRB,
) -> Result<<&Self as TensorBitOrAPI<TRB>>::Output>where
for<'a> &'a Self: TensorBitOrAPI<TRB>,
pub fn bitor<TRB>(&self, b: TRB) -> <&Self as TensorBitOrAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorBitOrAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn bitand_f<TRB>(
&self,
b: TRB,
) -> Result<<&Self as TensorBitAndAPI<TRB>>::Output>where
for<'a> &'a Self: TensorBitAndAPI<TRB>,
pub fn bitand<TRB>(&self, b: TRB) -> <&Self as TensorBitAndAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorBitAndAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn bitxor_f<TRB>(
&self,
b: TRB,
) -> Result<<&Self as TensorBitXorAPI<TRB>>::Output>where
for<'a> &'a Self: TensorBitXorAPI<TRB>,
pub fn bitxor<TRB>(&self, b: TRB) -> <&Self as TensorBitXorAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorBitXorAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn shl_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorShlAPI<TRB>>::Output>where
for<'a> &'a Self: TensorShlAPI<TRB>,
pub fn shl<TRB>(&self, b: TRB) -> <&Self as TensorShlAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorShlAPI<TRB>,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn shr_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorShrAPI<TRB>>::Output>where
for<'a> &'a Self: TensorShrAPI<TRB>,
pub fn shr<TRB>(&self, b: TRB) -> <&Self as TensorShrAPI<TRB>>::Outputwhere
for<'a> &'a Self: TensorShrAPI<TRB>,
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>where
R: DataMutAPI<Data = B::Raw>,
D: DimAPI + DimSmallerOneAPI,
D::SmallerOne: DimAPI,
B: DeviceAPI<T> + DeviceOpPackTriAPI<T> + DeviceCreationAnyAPI<T>,
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>where
R: DataMutAPI<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> TensorBase<Storage<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> TensorBase<Storage<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<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn neg_f(&self) -> Result<<&Self as TensorNegAPI>::Output>where
for<'a> &'a Self: TensorNegAPI,
pub fn neg(&self) -> <&Self as TensorNegAPI>::Outputwhere
for<'a> &'a Self: TensorNegAPI,
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
impl<S, D> TensorBase<S, D>where
D: DimAPI,
pub fn not_f(&self) -> Result<<&Self as TensorNotAPI>::Output>where
for<'a> &'a Self: TensorNotAPI,
pub fn not(&self) -> <&Self as TensorNotAPI>::Outputwhere
for<'a> &'a Self: TensorNotAPI,
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Methods for tensor ownership conversion.
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>where
R: DataAPI<Data = B::Raw>,
R::Data: Clone,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, D>,
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>where
R: DataAPI<Data = B::Raw>,
R::Data: Clone,
D: DimAPI,
T: Clone,
B: DeviceAPI<T> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, D>,
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<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<T, B, D> TensorBase<Storage<DataOwned<<B as DeviceRawAPI<T>>::Raw>, T, B>, D>where
T: Clone,
D: DimAPI,
B: DeviceAPI<T, Raw = Vec<T>> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, Ix1>,
impl<T, B, D> TensorBase<Storage<DataOwned<<B as DeviceRawAPI<T>>::Raw>, T, B>, D>where
T: Clone,
D: DimAPI,
B: DeviceAPI<T, Raw = Vec<T>> + DeviceCreationAnyAPI<T> + OpAssignAPI<T, Ix1>,
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
pub fn to_scalar_f(&self) -> Result<T>
pub fn to_scalar(&self) -> T
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
Source§impl<S, D> TensorBase<S, D>where
D: DimAPI,
Basic definitions for tensor object.
impl<S, D> TensorBase<S, D>where
D: DimAPI,
Basic definitions for tensor object.
Sourcepub unsafe fn new_unchecked(storage: S, layout: Layout<D>) -> Self
pub unsafe fn new_unchecked(storage: S, layout: Layout<D>) -> Self
Initialize tensor object.
§Safety
This function will not check whether data meets the standard of Storage<T, B>, or whether layout may exceed pointer bounds of data.
pub fn storage(&self) -> &S
pub fn storage_mut(&mut self) -> &mut S
pub fn layout(&self) -> &Layout<D>
pub fn shape(&self) -> &D
pub fn stride(&self) -> &D::Stride
pub fn offset(&self) -> usize
pub fn ndim(&self) -> usize
pub fn size(&self) -> usize
pub fn into_data(self) -> S
pub fn into_raw_parts(self) -> (S, Layout<D>)
Source§impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
impl<R, T, B, D> TensorBase<Storage<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<SA, DA, TRB> Add<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorAddAPI<TRB>,
impl<SA, DA, TRB> Add<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorAddAPI<TRB>,
Source§impl<SA, DA, TRB> BitAnd<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorBitAndAPI<TRB>,
impl<SA, DA, TRB> BitAnd<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorBitAndAPI<TRB>,
Source§impl<SA, DA, TRB> BitOr<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorBitOrAPI<TRB>,
impl<SA, DA, TRB> BitOr<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorBitOrAPI<TRB>,
Source§impl<SA, DA, TRB> BitXor<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorBitXorAPI<TRB>,
impl<SA, DA, TRB> BitXor<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorBitXorAPI<TRB>,
Source§impl<S: Clone, D> Clone for TensorBase<S, D>
impl<S: Clone, D> Clone for TensorBase<S, D>
Source§fn clone(&self) -> TensorBase<S, D>
fn clone(&self) -> TensorBase<S, D>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<SA, DA, TRB> Div<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorDivAPI<TRB>,
impl<SA, DA, TRB> Div<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorDivAPI<TRB>,
Source§impl<SA, DA, TRB> Mul<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorMulAPI<TRB>,
impl<SA, DA, TRB> Mul<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorMulAPI<TRB>,
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<SA, DA, TRB> Shl<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorShlAPI<TRB>,
impl<SA, DA, TRB> Shl<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorShlAPI<TRB>,
Source§impl<SA, DA, TRB> Shr<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorShrAPI<TRB>,
impl<SA, DA, TRB> Shr<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorShrAPI<TRB>,
Source§impl<SA, DA, TRB> Sub<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorSubAPI<TRB>,
impl<SA, DA, TRB> Sub<TRB> for &TensorBase<SA, DA>where
DA: DimAPI,
Self: TensorSubAPI<TRB>,
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorATan2API<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceATan2API<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorATan2API<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceATan2API<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceATan2API<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceATan2API<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn atan2_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn atan2(&self, b: &TRB) -> Self::Output
Source§impl<RA, DA, RB, DB, T, B> TensorAssignAPI<&TensorBase<Storage<RB, T, B>, DB>> for TensorAny<RA, T, B, DA>where
RA: DataMutAPI<Data = B::Raw>,
RB: DataAPI<Data = B::Raw>,
DA: DimAPI,
DB: DimAPI,
B: DeviceAPI<T> + OpAssignAPI<T, DA>,
impl<RA, DA, RB, DB, T, B> TensorAssignAPI<&TensorBase<Storage<RB, T, B>, DB>> for TensorAny<RA, T, B, DA>where
RA: DataMutAPI<Data = B::Raw>,
RB: DataAPI<Data = B::Raw>,
DA: DimAPI,
DB: DimAPI,
B: DeviceAPI<T> + OpAssignAPI<T, DA>,
Source§impl<RA, DA, RB, DB, T, B> TensorAssignAPI<TensorBase<Storage<RB, T, B>, DB>> for TensorAny<RA, T, B, DA>where
RA: DataMutAPI<Data = B::Raw>,
RB: DataAPI<Data = B::Raw>,
DA: DimAPI,
DB: DimAPI,
B: DeviceAPI<T> + OpAssignAPI<T, DA>,
impl<RA, DA, RB, DB, T, B> TensorAssignAPI<TensorBase<Storage<RB, T, B>, DB>> for TensorAny<RA, T, B, DA>where
RA: DataMutAPI<Data = B::Raw>,
RB: DataAPI<Data = B::Raw>,
DA: DimAPI,
DB: DimAPI,
B: DeviceAPI<T> + OpAssignAPI<T, DA>,
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorCopySignAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceCopySignAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorCopySignAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceCopySignAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceCopySignAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceCopySignAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn copysign_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn copysign(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorEqualAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceEqualAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorEqualAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceEqualAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceEqualAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceEqualAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn equal_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn equal(&self, b: &TRB) -> Self::Output
fn eq_f(&self, b: &TRB) -> Result<Self::Output>
fn eq(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorFloorDivideAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceFloorDivideAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorFloorDivideAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceFloorDivideAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceFloorDivideAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceFloorDivideAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn floor_divide_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn floor_divide(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorGreaterAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceGreaterAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorGreaterAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceGreaterAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceGreaterAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceGreaterAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn greater_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn greater(&self, b: &TRB) -> Self::Output
fn gt_f(&self, b: &TRB) -> Result<Self::Output>
fn gt(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorGreaterEqualAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceGreaterEqualAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorGreaterEqualAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceGreaterEqualAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceGreaterEqualAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceGreaterEqualAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn greater_equal_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn greater_equal(&self, b: &TRB) -> Self::Output
fn ge_f(&self, b: &TRB) -> Result<Self::Output>
fn ge(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorHypotAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceHypotAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorHypotAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceHypotAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceHypotAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceHypotAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn hypot_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn hypot(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorLessAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceLessAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorLessAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceLessAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceLessAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceLessAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn less_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn less(&self, b: &TRB) -> Self::Output
fn lt_f(&self, b: &TRB) -> Result<Self::Output>
fn lt(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorLessEqualAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceLessEqualAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorLessEqualAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceLessEqualAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceLessEqualAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceLessEqualAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn less_equal_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn less_equal(&self, b: &TRB) -> Self::Output
fn le_f(&self, b: &TRB) -> Result<Self::Output>
fn le(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorLogAddExpAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceLogAddExpAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorLogAddExpAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceLogAddExpAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceLogAddExpAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceLogAddExpAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn log_add_exp_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn log_add_exp(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorMaximumAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceMaximumAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorMaximumAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceMaximumAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceMaximumAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceMaximumAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn maximum_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn maximum(&self, b: &TRB) -> Self::Output
fn max_f(&self, b: &TRB) -> Result<Self::Output>
fn max(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorMinimumAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceMinimumAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorMinimumAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceMinimumAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceMinimumAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceMinimumAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn minimum_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn minimum(&self, b: &TRB) -> Self::Output
fn min_f(&self, b: &TRB) -> Result<Self::Output>
fn min(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorNotEqualAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceNotEqualAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorNotEqualAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DeviceNotEqualAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DeviceNotEqualAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DeviceNotEqualAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn not_equal_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn not_equal(&self, b: &TRB) -> Self::Output
fn ne_f(&self, b: &TRB) -> Result<Self::Output>
fn ne(&self, b: &TRB) -> Self::Output
Source§impl<RA, TA, DA, RB, TB, DB, B> TensorPowAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DevicePowAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
impl<RA, TA, DA, RB, TB, DB, B> TensorPowAPI<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 + DimMaxAPI<DB>,
DB: DimAPI,
DA::Max: DimAPI,
B: DevicePowAPI<TA, TB, DA::Max> + DeviceAPI<TA> + DeviceAPI<TB> + DeviceAPI<B::TOut> + DeviceCreationAnyAPI<B::TOut>,
type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<<B as DevicePowAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut>>::Raw>, <B as DevicePowAPI<TA, TB, <DA as DimMaxAPI<DB>>::Max>>::TOut, B>, <DA as DimMaxAPI<DB>>::Max>
fn pow_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>
fn pow(&self, b: &TRB) -> Self::Output
impl<R, D> Send for TensorBase<R, D>
impl<R, D> Sync for TensorBase<R, D>
impl<R, D> TensorBaseAPI for TensorBase<R, D>where
D: DimAPI,
Auto Trait Implementations§
impl<S, D> Freeze for TensorBase<S, D>
impl<S, D> RefUnwindSafe for TensorBase<S, D>
impl<S, D> Unpin for TensorBase<S, D>
impl<S, D> UnwindSafe for TensorBase<S, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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