Struct TensorBase

Source
pub struct TensorBase<S, D>
where D: DimAPI,
{ /* private fields */ }

Implementations§

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn assign_f<TRB>(&mut self, b: TRB) -> Result<()>
where Self: TensorAssignAPI<TRB>,

Source

pub fn assign<TRB>(&mut self, b: TRB)
where Self: TensorAssignAPI<TRB>,

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> + DeviceCreationAnyAPI<T>,

Source

pub fn full_like(&self, fill: T) -> Tensor<T, B, D>

Source

pub fn full_like_f(&self, fill: T) -> Result<Tensor<T, B, D>>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, T: Num, B: DeviceAPI<T> + DeviceCreationNumAPI<T>,

Source

pub fn ones_like(&self) -> Tensor<T, B, D>

New tensor filled with ones and having the same shape as an input tensor.

§See also

ones_like

Source

pub fn ones_like_f(&self) -> Result<Tensor<T, B, D>>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, T: Num, B: DeviceAPI<T> + DeviceCreationNumAPI<T>,

Source

pub fn zeros_like(&self) -> Tensor<T, B, D>

New tensor filled with zeros and having the same shape as an input tensor.

§See also

zeros_like

Source

pub fn zeros_like_f(&self) -> Result<Tensor<T, B, D>>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub fn into_slice_f<I>(self, index: I) -> Result<TensorAny<R, T, B, IxD>>

Source

pub fn into_slice<I>(self, index: I) -> TensorAny<R, T, B, IxD>

Source

pub fn slice_f<I>(&self, index: I) -> Result<TensorView<'_, T, B, IxD>>

Source

pub fn slice<I>(&self, index: I) -> TensorView<'_, T, B, IxD>

Source

pub fn i_f<I>(&self, index: I) -> Result<TensorView<'_, T, B, IxD>>

Source

pub fn i<I>(&self, index: I) -> TensorView<'_, T, B, IxD>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataMutAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub fn into_slice_mut_f<I>(self, index: I) -> Result<TensorAny<R, T, B, IxD>>

Source

pub fn into_slice_mut<I>(self, index: I) -> TensorAny<R, T, B, IxD>

Source

pub fn slice_mut_f<I>(&mut self, index: I) -> Result<TensorMut<'_, T, B, IxD>>

Source

pub fn slice_mut<I>(&mut self, index: I) -> TensorMut<'_, T, B, IxD>

Source

pub fn i_mut_f<I>(&mut self, index: I) -> Result<TensorMut<'_, T, B, IxD>>

Source

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>
where T: Clone, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>>,

Source

pub unsafe fn index_uncheck<I>(&self, index: I) -> &T
where I: AsRef<[usize]>,

§Safety

This function is unsafe because it does not check the validity of the index.

Source§

impl<T, B, D> TensorBase<Storage<DataRef<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
where T: Clone, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>>,

Source

pub unsafe fn index_uncheck<I>(&self, index: I) -> &T
where I: AsRef<[usize]>,

§Safety

This function is unsafe because it does not check the validity of the index.

Source§

impl<T, B, D> TensorBase<Storage<DataMut<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
where T: Clone, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>>,

Source

pub unsafe fn index_uncheck<I>(&self, index: I) -> &T
where I: AsRef<[usize]>,

§Safety

This function is unsafe because it does not check the validity of the index.

Source§

impl<T, B, D> TensorBase<Storage<DataCow<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
where T: Clone, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>>,

Source

pub unsafe fn index_uncheck<I>(&self, index: I) -> &T
where I: AsRef<[usize]>,

§Safety

This function is unsafe because it does not check the validity of the index.

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

Source

pub unsafe fn index_mut_uncheck<I>(&mut self, index: I) -> &mut T
where I: AsRef<[usize]>,

§Safety

This function is unsafe because it does not check the validity of the index.

Source§

impl<T, B, D> TensorBase<Storage<DataMut<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
where T: Clone, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>>,

Source

pub unsafe fn index_mut_uncheck<I>(&mut self, index: I) -> &mut T
where I: AsRef<[usize]>,

§Safety

This function is unsafe because it does not check the validity of the index.

Source§

impl<'a, R, T, B, D> TensorBase<Storage<R, T, B>, D>
where T: Clone, R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>> + 'a,

Source

pub fn axes_iter_with_order_f<I>( &self, axes: I, order: TensorIterOrder, ) -> Result<IterAxesView<'a, T, B>>

Source

pub fn axes_iter_f<I>(&self, axes: I) -> Result<IterAxesView<'a, T, B>>

Source

pub fn axes_iter_with_order<I>( &self, axes: I, order: TensorIterOrder, ) -> IterAxesView<'a, T, B>

Source

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>
where T: Clone, R: DataMutAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>> + 'a,

Source

pub fn axes_iter_mut_with_order_f<I>( &'a mut self, axes: I, order: TensorIterOrder, ) -> Result<IterAxesMut<'a, T, B>>

Source

pub fn axes_iter_mut_f<I>( &'a mut self, axes: I, ) -> Result<IterAxesMut<'a, T, B>>

Source

pub fn axes_iter_mut_with_order<I>( &'a mut self, axes: I, order: TensorIterOrder, ) -> IterAxesMut<'a, T, B>

Source

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>
where T: Clone, R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>> + 'a,

Source

pub fn indexed_axes_iter_with_order_f<I>( &self, axes: I, order: TensorIterOrder, ) -> Result<IndexedIterAxesView<'a, T, B>>

Source

pub fn indexed_axes_iter_f<I>( &self, axes: I, ) -> Result<IndexedIterAxesView<'a, T, B>>

Source

pub fn indexed_axes_iter_with_order<I>( &self, axes: I, order: TensorIterOrder, ) -> IndexedIterAxesView<'a, T, B>

Source

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>
where T: Clone, R: DataMutAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>> + 'a,

Source

pub fn indexed_axes_iter_mut_with_order_f<I>( &'a mut self, axes: I, order: TensorIterOrder, ) -> Result<IndexedIterAxesMut<'a, T, B>>

Source

pub fn indexed_axes_iter_mut_f<I>( &'a mut self, axes: I, ) -> Result<IndexedIterAxesMut<'a, T, B>>

Source

pub fn indexed_axes_iter_mut_with_order<I>( &'a mut self, axes: I, order: TensorIterOrder, ) -> IndexedIterAxesMut<'a, T, B>

Source

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>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>> + 'a,

Source

pub fn iter_with_order_f( &self, order: TensorIterOrder, ) -> Result<IterVecView<'a, T, D>>

Source

pub fn iter_with_order(&self, order: TensorIterOrder) -> IterVecView<'a, T, D>

Source

pub fn iter_f(&self) -> Result<IterVecView<'a, T, D>>

Source

pub fn iter(&self) -> IterVecView<'a, T, D>

Source§

impl<'a, R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataMutAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>> + 'a,

Source

pub fn iter_mut_with_order_f( &'a mut self, order: TensorIterOrder, ) -> Result<IterVecMut<'a, T, D>>

Source

pub fn iter_mut_with_order( &'a mut self, order: TensorIterOrder, ) -> IterVecMut<'a, T, D>

Source

pub fn iter_mut_f(&'a mut self) -> Result<IterVecMut<'a, T, D>>

Source

pub fn iter_mut(&'a mut self) -> IterVecMut<'a, T, D>

Source§

impl<'a, R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>> + 'a,

Source§

impl<'a, R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataMutAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>> + 'a,

Source

pub fn indexed_iter_mut_with_order_f( &'a mut self, order: TensorIterOrder, ) -> Result<IndexedIterVecMut<'a, T, D>>

Source

pub fn indexed_iter_mut_with_order( &'a mut self, order: TensorIterOrder, ) -> IndexedIterVecMut<'a, T, D>

Source

pub fn indexed_iter_mut_f(&'a mut self) -> Result<IndexedIterVecMut<'a, T, D>>

Source

pub fn indexed_iter_mut(&'a mut self) -> IndexedIterVecMut<'a, T, D>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub fn to_broadcast<D2>(&self, shape: D2) -> TensorView<'_, T, B, D2>
where D2: DimAPI, D: DimMaxAPI<D2, Max = D2>,

Broadcasts an array to a specified shape.

§See also

to_broadcast

Source

pub fn to_broadcast_f<D2>(&self, shape: D2) -> Result<TensorView<'_, T, B, D2>>
where D2: DimAPI, D: DimMaxAPI<D2, Max = D2>,

Source

pub fn into_broadcast<D2>(self, shape: D2) -> TensorAny<R, T, B, D2>
where D2: DimAPI, D: DimMaxAPI<D2, Max = D2>,

Broadcasts an array to a specified shape.

§See also

to_broadcast

Source

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>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

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

expand_dims

Source

pub fn expand_dims_f<I>(&self, axes: I) -> Result<TensorView<'_, T, B, IxD>>

Source

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

expand_dims

Source

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>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub fn flip<I>(&self, axis: I) -> TensorView<'_, T, B, D>

Reverses the order of elements in an array along the given axis.

§See also

flip

Source

pub fn flip_f<I>(&self, axis: I) -> Result<TensorView<'_, T, B, D>>

Source

pub fn into_flip<I>(self, axis: I) -> TensorAny<R, T, B, D>

Reverses the order of elements in an array along the given axis.

§See also

flip

Source

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>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub fn transpose<I>(&self, axes: I) -> TensorView<'_, T, B, D>

Permutes the axes (dimensions) of an array x.

§See also

transpose

Source

pub fn transpose_f<I>(&self, axes: I) -> Result<TensorView<'_, T, B, D>>

Source

pub fn into_transpose<I>(self, axes: I) -> TensorAny<R, T, B, D>

Permutes the axes (dimensions) of an array x.

§See also

transpose

Source

pub fn into_transpose_f<I>(self, axes: I) -> Result<TensorAny<R, T, B, D>>

Source

pub fn permute_dims<I>(&self, axes: I) -> TensorView<'_, T, B, D>

Permutes the axes (dimensions) of an array x.

§See also

transpose

Source

pub fn permute_dims_f<I>(&self, axes: I) -> Result<TensorView<'_, T, B, D>>

Source

pub fn into_permute_dims<I>(self, axes: I) -> TensorAny<R, T, B, D>

Permutes the axes (dimensions) of an array x.

§See also

transpose

Source

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>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub fn reverse_axes(&self) -> TensorView<'_, T, B, D>

Reverse the order of elements in an array along the given axis.

§See also

reverse_axes

Source

pub fn into_reverse_axes(self) -> TensorAny<R, T, B, D>

Reverse the order of elements in an array along the given axis.

§See also

reverse_axes

Source

pub fn t(&self) -> TensorView<'_, T, B, D>

Reverse the order of elements in an array along the given axis.

§See also

reverse_axes

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub fn swapaxes<I>(&self, axis1: I, axis2: I) -> TensorView<'_, T, B, D>
where I: TryInto<isize>,

Interchange two axes of an array.

§See also

swapaxes

Source

pub fn swapaxes_f<I>( &self, axis1: I, axis2: I, ) -> Result<TensorView<'_, T, B, D>>
where I: TryInto<isize>,

Source

pub fn into_swapaxes<I>(self, axis1: I, axis2: I) -> TensorAny<R, T, B, D>
where I: TryInto<isize>,

Interchange two axes of an array.

§See also

swapaxes

Source

pub fn into_swapaxes_f<I>( self, axis1: I, axis2: I, ) -> Result<TensorAny<R, T, B, D>>
where I: TryInto<isize>,

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub fn squeeze<I>(&self, axis: I) -> TensorView<'_, T, B, IxD>

Removes singleton dimensions (axes) from x.

§See also

squeeze

Source

pub fn squeeze_f<I>(&self, axis: I) -> Result<TensorView<'_, T, B, IxD>>

Source

pub fn into_squeeze<I>(self, axis: I) -> TensorAny<R, T, B, IxD>

Removes singleton dimensions (axes) from x.

§See also

squeeze

Source

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>
where D: DimAPI, R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>,

Source

pub fn to_dim<D2>(&self) -> TensorView<'_, T, B, D2>
where D2: DimAPI, D: DimIntoAPI<D2>,

Convert layout to the other dimension.

This is mostly used when converting static dimension to dynamic dimension or vice versa.

§See also

into_dim

Source

pub fn to_dim_f<D2>(&self) -> Result<TensorView<'_, T, B, D2>>
where D2: DimAPI, D: DimIntoAPI<D2>,

Source

pub fn into_dim<D2>(self) -> TensorAny<R, T, B, D2>
where D2: DimAPI, D: DimIntoAPI<D2>,

Convert layout to another dimension.

§See also

into_dim

Source

pub fn into_dim_f<D2>(self) -> Result<TensorAny<R, T, B, D2>>
where D2: DimAPI, D: DimIntoAPI<D2>,

Source

pub fn to_dyn(&self) -> TensorView<'_, T, B, IxD>

Convert layout to dynamic dimension.

Source

pub fn into_dyn(self) -> TensorAny<R, T, B, IxD>

Convert layout to dynamic dimension.

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

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

reshape_assume_contig

Source

pub fn reshape_assume_contig_f<D2>( &self, shape: D2, ) -> Result<TensorView<'_, T, B, D2>>
where D2: DimAPI,

Source

pub fn to_shape_assume_contig<D2>(&self, shape: D2) -> TensorView<'_, T, B, D2>
where D2: DimAPI,

Source

pub fn to_shape_assume_contig_f<D2>( &self, shape: D2, ) -> Result<TensorView<'_, T, B, D2>>
where D2: DimAPI,

Source

pub fn into_shape_assume_contig<D2>(self, shape: D2) -> TensorAny<R, T, B, D2>
where D2: DimAPI,

Source

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,

Source

pub fn change_shape_f<I>(self, shape: I) -> Result<TensorCow<'a, T, B, IxD>>

Source

pub fn change_shape<I>(self, shape: I) -> TensorCow<'a, T, B, IxD>

Source

pub fn into_shape_f<I>(self, shape: I) -> Result<Tensor<T, B, IxD>>
where I: TryInto<AxesIndex<isize>>, Error: From<I::Error>, B::Raw: 'a,

Source

pub fn into_shape<I>(self, shape: I) -> Tensor<T, B, IxD>
where I: TryInto<AxesIndex<isize>>, Error: From<I::Error>, B::Raw: 'a,

Source

pub fn to_shape_f<I>(&'a self, shape: I) -> Result<TensorCow<'a, T, B, IxD>>

Source

pub fn to_shape<I>(&'a self, shape: I) -> TensorCow<'a, T, B, IxD>

Source

pub fn reshape_f<I>(&'a self, shape: I) -> Result<TensorCow<'a, T, B, IxD>>

Source

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

Source

pub fn to_layout<D2>(&self, layout: Layout<D2>) -> TensorCow<'_, T, B, D2>
where D2: DimAPI, B: OpAssignArbitaryAPI<T, D2, D>,

Convert tensor to the other layout.

§See also

to_layout

Source

pub fn to_layout_f<D2>( &self, layout: Layout<D2>, ) -> Result<TensorCow<'_, T, B, D2>>
where D2: DimAPI, B: OpAssignArbitaryAPI<T, D2, D>,

Source

pub fn into_layout_f<D2>(self, layout: Layout<D2>) -> Result<Tensor<T, B, D2>>
where D2: DimAPI, B: OpAssignArbitaryAPI<T, D2, D> + OpAssignAPI<T, D2>, B::Raw: 'a,

Source

pub fn into_layout<D2>(self, layout: Layout<D2>) -> Tensor<T, B, D2>
where D2: DimAPI, B: OpAssignArbitaryAPI<T, D2, D> + OpAssignAPI<T, D2>, B::Raw: 'a,

Source

pub fn change_layout_f<D2>( self, layout: Layout<D2>, ) -> Result<TensorCow<'a, T, B, D2>>
where D2: DimAPI, B: OpAssignArbitaryAPI<T, D2, D>,

Source

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>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T>,

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn mapi_fnmut_f<'f>(&mut self, f: impl FnMut(&mut T) + 'f) -> Result<()>
where R: DataMutAPI<Data = B::Raw>, B: DeviceOp_MutA_API<T, D, dyn FnMut(&mut T) + 'f>,

Modify the tensor in place by calling f by mutable reference on each element.

Source

pub fn mapi_fnmut<'f>(&mut self, f: impl FnMut(&mut T) + 'f)
where R: DataMutAPI<Data = B::Raw>, B: DeviceOp_MutA_API<T, D, dyn FnMut(&mut T) + 'f>,

Modify the tensor in place by calling f by mutable reference on each element.

Source

pub fn mapvi_fnmut_f<'f>(&mut self, f: impl FnMut(T) -> T + 'f) -> Result<()>
where R: DataMutAPI<Data = B::Raw>, T: Clone, B: DeviceOp_MutA_API<T, D, dyn FnMut(&mut T) + 'f>,

Modify the tensor in place by calling f by value on each element.

Source

pub fn mapvi_fnmut<'f>(&mut self, f: impl FnMut(T) -> T + 'f)
where R: DataMutAPI<Data = B::Raw>, T: Clone, B: DeviceOp_MutA_API<T, D, dyn FnMut(&mut 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>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T>, T: Clone,

Source

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

Source

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

Source

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

Source

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>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T>,

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn mapi_f<'f>( &mut self, f: impl Fn(&mut T) + Send + Sync + 'f, ) -> Result<()>
where R: DataMutAPI<Data = B::Raw>, B: DeviceOp_MutA_API<T, D, dyn Fn(&mut T) + Send + Sync + 'f>,

Modify the tensor in place by calling f by mutable reference on each element.

Source

pub fn mapi<'f>(&mut self, f: impl Fn(&mut T) + Send + Sync + 'f)
where R: DataMutAPI<Data = B::Raw>, B: DeviceOp_MutA_API<T, D, dyn Fn(&mut T) + Send + Sync + 'f>,

Modify the tensor in place by calling f by mutable reference on each element.

Source

pub fn mapvi_f<'f>( &mut self, f: impl Fn(T) -> T + Send + Sync + 'f, ) -> Result<()>
where R: DataMutAPI<Data = B::Raw>, T: Clone, B: DeviceOp_MutA_API<T, D, dyn Fn(&mut T) + Send + Sync + 'f>,

Modify the tensor in place by calling f by value on each element.

Source

pub fn mapvi<'f>(&mut self, f: impl Fn(T) -> T + Send + Sync + 'f)
where R: DataMutAPI<Data = B::Raw>, T: Clone, B: DeviceOp_MutA_API<T, D, dyn Fn(&mut T) + Send + Sync + '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>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T>, T: Clone,

Source

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

Source

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

Source

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>>
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 Fn(&mut TOut, &T, &T2) + Send + Sync + 'f>,

Source

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>
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 Fn(&mut TOut, &T, &T2) + Send + Sync + 'f>,

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = <B as DeviceRawAPI<T>>::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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,

Source

pub fn add_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorAddAPI<TRB>>::Output>
where for<'a> &'a Self: TensorAddAPI<TRB>,

Source

pub fn add<TRB>(&self, b: TRB) -> <&Self as TensorAddAPI<TRB>>::Output
where for<'a> &'a Self: TensorAddAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn sub_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorSubAPI<TRB>>::Output>
where for<'a> &'a Self: TensorSubAPI<TRB>,

Source

pub fn sub<TRB>(&self, b: TRB) -> <&Self as TensorSubAPI<TRB>>::Output
where for<'a> &'a Self: TensorSubAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn mul_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorMulAPI<TRB>>::Output>
where for<'a> &'a Self: TensorMulAPI<TRB>,

Source

pub fn mul<TRB>(&self, b: TRB) -> <&Self as TensorMulAPI<TRB>>::Output
where for<'a> &'a Self: TensorMulAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn div_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorDivAPI<TRB>>::Output>
where for<'a> &'a Self: TensorDivAPI<TRB>,

Source

pub fn div<TRB>(&self, b: TRB) -> <&Self as TensorDivAPI<TRB>>::Output
where for<'a> &'a Self: TensorDivAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn rem_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorRemAPI<TRB>>::Output>
where for<'a> &'a Self: TensorRemAPI<TRB>,

Source

pub fn rem<TRB>(&self, b: TRB) -> <&Self as TensorRemAPI<TRB>>::Output
where for<'a> &'a Self: TensorRemAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn bitor_f<TRB>( &self, b: TRB, ) -> Result<<&Self as TensorBitOrAPI<TRB>>::Output>
where for<'a> &'a Self: TensorBitOrAPI<TRB>,

Source

pub fn bitor<TRB>(&self, b: TRB) -> <&Self as TensorBitOrAPI<TRB>>::Output
where for<'a> &'a Self: TensorBitOrAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn bitand_f<TRB>( &self, b: TRB, ) -> Result<<&Self as TensorBitAndAPI<TRB>>::Output>
where for<'a> &'a Self: TensorBitAndAPI<TRB>,

Source

pub fn bitand<TRB>(&self, b: TRB) -> <&Self as TensorBitAndAPI<TRB>>::Output
where for<'a> &'a Self: TensorBitAndAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn bitxor_f<TRB>( &self, b: TRB, ) -> Result<<&Self as TensorBitXorAPI<TRB>>::Output>
where for<'a> &'a Self: TensorBitXorAPI<TRB>,

Source

pub fn bitxor<TRB>(&self, b: TRB) -> <&Self as TensorBitXorAPI<TRB>>::Output
where for<'a> &'a Self: TensorBitXorAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn shl_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorShlAPI<TRB>>::Output>
where for<'a> &'a Self: TensorShlAPI<TRB>,

Source

pub fn shl<TRB>(&self, b: TRB) -> <&Self as TensorShlAPI<TRB>>::Output
where for<'a> &'a Self: TensorShlAPI<TRB>,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn shr_f<TRB>(&self, b: TRB) -> Result<<&Self as TensorShrAPI<TRB>>::Output>
where for<'a> &'a Self: TensorShrAPI<TRB>,

Source

pub fn shr<TRB>(&self, b: TRB) -> <&Self as TensorShrAPI<TRB>>::Output
where 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>,

Source

pub fn pack_tri_f(&self, uplo: FlagUpLo) -> Result<Tensor<T, B, D::SmallerOne>>

Source

pub fn pack_tri(&self, uplo: FlagUpLo) -> Tensor<T, B, D::SmallerOne>

Source

pub fn pack_tril_f(&self) -> Result<Tensor<T, B, D::SmallerOne>>

Source

pub fn pack_tril(&self) -> Tensor<T, B, D::SmallerOne>

Source

pub fn pack_triu_f(&self) -> Result<Tensor<T, B, D::SmallerOne>>

Source

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

Source

pub fn unpack_tri( &self, uplo: FlagUpLo, symm: FlagSymm, ) -> Result<Tensor<T, B, D::LargerOne>>

Source

pub fn unpack_tril(&self, symm: FlagSymm) -> Tensor<T, B, D::LargerOne>

Source

pub fn unpack_triu(&self, symm: FlagSymm) -> Tensor<T, B, D::LargerOne>

Source

pub fn unpack_tri_f( &self, uplo: FlagUpLo, symm: FlagSymm, ) -> Result<Tensor<T, B, D::LargerOne>>

Source

pub fn unpack_tril_f( &self, symm: FlagSymm, ) -> Result<Tensor<T, B, D::LargerOne>>

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn neg_f(&self) -> Result<<&Self as TensorNegAPI>::Output>
where for<'a> &'a Self: TensorNegAPI,

Source

pub fn neg(&self) -> <&Self as TensorNegAPI>::Output
where for<'a> &'a Self: TensorNegAPI,

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Source

pub fn not_f(&self) -> Result<<&Self as TensorNotAPI>::Output>
where for<'a> &'a Self: TensorNotAPI,

Source

pub fn not(&self) -> <&Self as TensorNotAPI>::Output
where for<'a> &'a Self: TensorNotAPI,

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where D: DimAPI, B: DeviceAPI<T>, R: DataAPI<Data = B::Raw>,

Methods for tensor ownership conversion.

Source

pub fn view(&self) -> TensorView<'_, T, B, D>

Get a view of tensor.

Source

pub fn view_mut(&mut self) -> TensorMut<'_, T, B, D>
where R: DataMutAPI,

Get a mutable view of tensor.

Source

pub fn into_cow<'a>(self) -> TensorCow<'a, T, B, D>
where R: DataIntoCowAPI<'a>,

Convert current tensor into copy-on-write.

Source

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.

Source

pub fn into_shared_keep_layout(self) -> TensorArc<T, B, D>

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

Source

pub fn into_owned(self) -> Tensor<T, B, D>

Source

pub fn into_shared(self) -> TensorArc<T, B, D>

Source

pub fn to_owned(&self) -> Tensor<T, B, D>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw> + DataForceMutAPI<B::Raw>, B: DeviceAPI<T>, D: DimAPI,

Source

pub unsafe fn force_mut(&self) -> TensorMut<'_, T, B, D>

§Safety

This function is highly unsafe, as it entirely bypasses Rust’s lifetime and borrowing rules.

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

Source

pub fn to_raw_f(&self) -> Result<Vec<T>>

Source

pub fn to_vec(&self) -> Vec<T>

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

Source

pub fn into_vec_f(self) -> Result<Vec<T>>

Source

pub fn into_vec(self) -> Vec<T>

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

Source

pub fn to_scalar_f(&self) -> Result<T>

Source

pub fn to_scalar(&self) -> T

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T, Raw = Vec<T>>,

Source

pub fn as_ptr(&self) -> *const T

Source

pub fn as_mut_ptr(&mut self) -> *mut T
where R: DataMutAPI,

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: OpSumAPI<T, D>,

Source

pub fn sum_all_f(&self) -> Result<T>

Source

pub fn sum_all(&self) -> T

Source

pub fn sum_f<I>(&self, axes: I) -> Result<Tensor<T, B, IxD>>

Source

pub fn sum<I>(&self, axes: I) -> Tensor<T, B, IxD>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: OpMinAPI<T, D>,

Source

pub fn min_all_f(&self) -> Result<T>

Source

pub fn min_all(&self) -> T

Source

pub fn min_f<I>(&self, axes: I) -> Result<Tensor<T, B, IxD>>

Source

pub fn min<I>(&self, axes: I) -> Tensor<T, B, IxD>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: OpMaxAPI<T, D>,

Source

pub fn max_all_f(&self) -> Result<T>

Source

pub fn max_all(&self) -> T

Source

pub fn max_f<I>(&self, axes: I) -> Result<Tensor<T, B, IxD>>

Source

pub fn max<I>(&self, axes: I) -> Tensor<T, B, IxD>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: OpProdAPI<T, D>,

Source

pub fn prod_all_f(&self) -> Result<T>

Source

pub fn prod_all(&self) -> T

Source

pub fn prod_f<I>(&self, axes: I) -> Result<Tensor<T, B, IxD>>

Source

pub fn prod<I>(&self, axes: I) -> Tensor<T, B, IxD>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: OpMeanAPI<T, D>,

Source

pub fn mean_all_f(&self) -> Result<T>

Source

pub fn mean_all(&self) -> T

Source

pub fn mean_f<I>(&self, axes: I) -> Result<Tensor<T, B, IxD>>

Source

pub fn mean<I>(&self, axes: I) -> Tensor<T, B, IxD>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: OpVarAPI<T, D>,

Source

pub fn var_all_f(&self) -> Result<T>

Source

pub fn var_all(&self) -> T

Source

pub fn var_f<I>(&self, axes: I) -> Result<Tensor<T, B, IxD>>

Source

pub fn var<I>(&self, axes: I) -> Tensor<T, B, IxD>

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: OpStdAPI<T, D>,

Source

pub fn std_all_f(&self) -> Result<T>

Source

pub fn std_all(&self) -> T

Source

pub fn std_f<I>(&self, axes: I) -> Result<Tensor<T, B, IxD>>

Source

pub fn std<I>(&self, axes: I) -> Tensor<T, B, IxD>

Source§

impl<S, D> TensorBase<S, D>
where D: DimAPI,

Basic definitions for tensor object.

Source

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.

Source

pub fn storage(&self) -> &S

Source

pub fn storage_mut(&mut self) -> &mut S

Source

pub fn layout(&self) -> &Layout<D>

Source

pub fn shape(&self) -> &D

Source

pub fn stride(&self) -> &D::Stride

Source

pub fn offset(&self) -> usize

Source

pub fn ndim(&self) -> usize

Source

pub fn size(&self) -> usize

Source

pub fn into_data(self) -> S

Source

pub fn into_raw_parts(self) -> (S, Layout<D>)

Source§

impl<R, T, B, D> TensorBase<Storage<R, T, B>, D>
where R: DataAPI<Data = B::Raw>, D: DimAPI, B: DeviceAPI<T>,

Source

pub fn new_f(storage: Storage<R, T, B>, layout: Layout<D>) -> Result<Self>

Source

pub fn new(storage: Storage<R, T, B>, layout: Layout<D>) -> Self

Source

pub fn device(&self) -> &B

Source

pub fn data(&self) -> &R

Source

pub fn data_mut(&mut self) -> &mut R

Source

pub fn raw(&self) -> &B::Raw

Source

pub fn raw_mut(&mut self) -> &mut B::Raw
where R: DataMutAPI<Data = B::Raw>,

Source§

impl<T, B, D> TensorBase<Storage<DataCow<'_, <B as DeviceRawAPI<T>>::Raw>, T, B>, D>
where B: DeviceAPI<T>, D: DimAPI,

Source

pub fn is_owned(&self) -> bool

Source

pub fn is_ref(&self) -> bool

Trait Implementations§

Source§

impl<SA, DA, TRB> Add<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorAddAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorAddAPI<TRB>>::Output

The resulting type after applying the + operator.
Source§

fn add(self, b: TRB) -> Self::Output

Performs the + operation. Read more
Source§

impl<SA, DA, TRB> BitAnd<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorBitAndAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorBitAndAPI<TRB>>::Output

The resulting type after applying the & operator.
Source§

fn bitand(self, b: TRB) -> Self::Output

Performs the & operation. Read more
Source§

impl<SA, DA, TRB> BitOr<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorBitOrAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorBitOrAPI<TRB>>::Output

The resulting type after applying the | operator.
Source§

fn bitor(self, b: TRB) -> Self::Output

Performs the | operation. Read more
Source§

impl<SA, DA, TRB> BitXor<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorBitXorAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorBitXorAPI<TRB>>::Output

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, b: TRB) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<S: Clone, D> Clone for TensorBase<S, D>
where D: DimAPI + Clone,

Source§

fn clone(&self) -> TensorBase<S, D>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<SA, DA, TRB> Div<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorDivAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorDivAPI<TRB>>::Output

The resulting type after applying the / operator.
Source§

fn div(self, b: TRB) -> Self::Output

Performs the / operation. Read more
Source§

impl<SA, DA, TRB> Mul<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorMulAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorMulAPI<TRB>>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, b: TRB) -> Self::Output

Performs the * operation. Read more
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>,

Source§

type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<TC>>::Raw>, TC, B>, DC>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &TensorAny<RB, TB, B, DB>) -> Self::Output

Performs the % operation. Read more
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>,

Source§

type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<TC>>::Raw>, TC, B>, DC>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &TensorAny<RB, TB, B, DB>) -> Self::Output

Performs the % operation. Read more
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>,

Source§

type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<TC>>::Raw>, TC, B>, DC>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: TensorAny<RB, TB, B, DB>) -> Self::Output

Performs the % operation. Read more
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>,

Source§

type Output = TensorBase<Storage<DataOwned<<B as DeviceRawAPI<TC>>::Raw>, TC, B>, DC>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: TensorAny<RB, TB, B, DB>) -> Self::Output

Performs the % operation. Read more
Source§

impl<SA, DA, TRB> Shl<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorShlAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorShlAPI<TRB>>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, b: TRB) -> Self::Output

Performs the << operation. Read more
Source§

impl<SA, DA, TRB> Shr<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorShrAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorShrAPI<TRB>>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, b: TRB) -> Self::Output

Performs the >> operation. Read more
Source§

impl<SA, DA, TRB> Sub<TRB> for &TensorBase<SA, DA>
where DA: DimAPI, Self: TensorSubAPI<TRB>,

Source§

type Output = <&TensorBase<SA, DA> as TensorSubAPI<TRB>>::Output

The resulting type after applying the - operator.
Source§

fn sub(self, b: TRB) -> Self::Output

Performs the - operation. Read more
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>,

Source§

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>

Source§

fn atan2_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

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

Source§

fn assign_f(a: &mut Self, b: &TensorAny<RB, T, B, DB>) -> Result<()>

Source§

fn assign(a: &mut Self, b: TRB)

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

Source§

fn assign_f(a: &mut Self, b: TensorAny<RB, T, B, DB>) -> Result<()>

Source§

fn assign(a: &mut Self, b: TRB)

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

Source§

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>

Source§

fn copysign_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn equal_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn equal(&self, b: &TRB) -> Self::Output

Source§

fn eq_f(&self, b: &TRB) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn floor_divide_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn greater_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn greater(&self, b: &TRB) -> Self::Output

Source§

fn gt_f(&self, b: &TRB) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn greater_equal_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn greater_equal(&self, b: &TRB) -> Self::Output

Source§

fn ge_f(&self, b: &TRB) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn hypot_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn less_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn less(&self, b: &TRB) -> Self::Output

Source§

fn lt_f(&self, b: &TRB) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn less_equal_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn less_equal(&self, b: &TRB) -> Self::Output

Source§

fn le_f(&self, b: &TRB) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn log_add_exp_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn maximum_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn maximum(&self, b: &TRB) -> Self::Output

Source§

fn max_f(&self, b: &TRB) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn minimum_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn minimum(&self, b: &TRB) -> Self::Output

Source§

fn min_f(&self, b: &TRB) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn not_equal_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn not_equal(&self, b: &TRB) -> Self::Output

Source§

fn ne_f(&self, b: &TRB) -> Result<Self::Output>

Source§

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

Source§

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>

Source§

fn pow_f(&self, b: &TensorAny<RB, TB, B, DB>) -> Result<Self::Output>

Source§

fn pow(&self, b: &TRB) -> Self::Output

Source§

impl<R, D> Send for TensorBase<R, D>
where D: DimAPI, R: Send,

Source§

impl<R, D> Sync for TensorBase<R, D>
where D: DimAPI, R: Sync,

Source§

impl<R, D> TensorBaseAPI for TensorBase<R, D>
where D: DimAPI,

Auto Trait Implementations§

§

impl<S, D> Freeze for TensorBase<S, D>
where S: Freeze, D: Freeze, <D as DimBaseAPI>::Stride: Freeze,

§

impl<S, D> RefUnwindSafe for TensorBase<S, D>

§

impl<S, D> Unpin for TensorBase<S, D>
where S: Unpin, D: Unpin, <D as DimBaseAPI>::Stride: Unpin,

§

impl<S, D> UnwindSafe for TensorBase<S, D>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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

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

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

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,