pub struct ArrTensor<T, const N: usize, const D: usize, const LANES: usize = MAX_SIMD_SINGLE_PRECISION_LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,{ /* private fields */ }Expand description
A tensor made up of statically sized arrays.
Often the best choice for embedded tensor operations because it doesn’t use any OS-dependent features like heap allocators.
If memory efficiency is the largest concern, the lack of dynamic heap allocation is a huge positive of ArrTensor.
However, when flexibility is put before memory efficiency and performance, this becomes obsolete; use DynTensor instead.
Implementations§
Source§impl<T, const N: usize, const D: usize, const LANES: usize> ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Sourcepub fn new(shape: [usize; D]) -> Self
pub fn new(shape: [usize; D]) -> Self
Instantiates a new Tensor which owns its data without allocating it.
§Panics
This constructor panics when the product of each dimension is not equal to the length of all the data.
Sourcepub fn with_data(shape: [usize; D], data: [T; N]) -> Self
pub fn with_data(shape: [usize; D], data: [T; N]) -> Self
Instantiates a new Tensor with data.
§Panics
This constructor panics when the product of each dimension is not equal to the length of all the data.
Example:
use tensor_optim::ArrTensor;
const SHAPE: [usize; 2] = [2, 3];
let data = [0f64; 6];
let mut tensor = ArrTensor::with_data(SHAPE, data);
tensor += 42.0;
println!("First element: {}", tensor[&[0, 0]]);Source§impl<T, const N: usize, const D: usize, const LANES: usize> ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Sourcepub fn map<U, F>(&self, f: F) -> ArrTensor<U, N, D, LANES>
pub fn map<U, F>(&self, f: F) -> ArrTensor<U, N, D, LANES>
Map each element of ArrTensor<T, N, D, LANES> to ArrTensor<U, N, D> by applying f elementwise.
Sourcepub fn zip_map<U, V, F>(
&self,
other: &ArrTensor<U, N, D, LANES>,
f: F,
) -> ArrTensor<V, N, D, LANES>where
U: SimdElement + Primitive,
[U; LANES]: AlignedSimd<[U; LANES], U, LANES>,
V: SimdElement + Primitive,
[V; LANES]: AlignedSimd<[V; LANES], V, LANES>,
F: FnMut(T, U) -> V,
pub fn zip_map<U, V, F>(
&self,
other: &ArrTensor<U, N, D, LANES>,
f: F,
) -> ArrTensor<V, N, D, LANES>where
U: SimdElement + Primitive,
[U; LANES]: AlignedSimd<[U; LANES], U, LANES>,
V: SimdElement + Primitive,
[V; LANES]: AlignedSimd<[V; LANES], V, LANES>,
F: FnMut(T, U) -> V,
Apply a function pairwise elementwise over two ArrTensors, mapping to a new tensor.
§Panics
Both tensors, self and other, must have the same shape or a panic will occur.
Source§impl<T, const N: usize, const D: usize, const LANES: usize> ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Sourcepub fn matmul<const M: usize, const O: usize>(
&self,
rhs: &ArrTensor<T, M, D, LANES>,
out: &mut ArrTensor<T, O, D, LANES>,
)
pub fn matmul<const M: usize, const O: usize>( &self, rhs: &ArrTensor<T, M, D, LANES>, out: &mut ArrTensor<T, O, D, LANES>, )
Batched matmul over arbitrary leading batch dims:
Contracts last dim of self with second-last dim of rhs.
Matrix multiplication cannot be performed on ArrTensors when the dimensions exceed MAX_STATIC_RANK.
To bypass this limit, DynTensor can be used which is allocated on the heap.
§Example
- self shape: […, M, K]
- rhs shape: […, K, N]
- output shape: […, M, N]
Output buffer must be preallocated.
§Panics
This method panics when if any of these conditions are not met:
- both tensors must have at least 2 dimensions
- each tensors’ inner and batch dimensions must match
- the output tensor must be the correct shape
Every one of those must be true.
Source§impl<const N: usize, const D: usize> ArrTensor<f32, N, D>
impl<const N: usize, const D: usize> ArrTensor<f32, N, D>
Sourcepub fn simd_matmul<const M: usize, const O: usize>(
&self,
rhs: &ArrTensor<f32, M, D>,
out: &mut ArrTensor<f32, O, D>,
)
pub fn simd_matmul<const M: usize, const O: usize>( &self, rhs: &ArrTensor<f32, M, D>, out: &mut ArrTensor<f32, O, D>, )
SIMD-accelerated matrix multiplication like Self::matmul.
This is purely an enhanced version of regular matrix multiplication with the addition of SIMD acceleration. Implementation and details should be found consulting that documentation, not this function.
§Panics
Same preconditions as generic matmul.
Source§impl<const N: usize, const D: usize> ArrTensor<f64, N, D>
impl<const N: usize, const D: usize> ArrTensor<f64, N, D>
Sourcepub fn simd_matmul<const M: usize, const O: usize>(
&self,
rhs: &ArrTensor<f64, M, D>,
out: &mut ArrTensor<f64, O, D>,
)
pub fn simd_matmul<const M: usize, const O: usize>( &self, rhs: &ArrTensor<f64, M, D>, out: &mut ArrTensor<f64, O, D>, )
SIMD-accelerated single-precision matrix multiplication like Self::matmul.
This is purely an enhanced version of regular matrix multiplication with the addition of SIMD acceleration. Implementation and details should be found consulting that documentation, not this function.
§Panics
Same preconditions as generic matmul.
Source§impl<T, const N: usize, const D: usize, const LANES: usize> ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Sourcepub fn transpose(&self) -> Self
pub fn transpose(&self) -> Self
Transposes the tensor using a default axis permutation:
- For 2D tensors, swaps the two axes.
- For higher-rank tensors, reverses the axes.
§Panics
Panics if D exceeds MAX_STATIC_RANK.
§Example
use tensor_optim::{ArrTensor, TensorOps};
let tensor = ArrTensor::<f32, 6, 2>::with_data([2, 3], [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);
let transposed = tensor.transpose();
assert_eq!(transposed.shape(), [3, 2]);
assert_eq!(transposed.data(), [1.0, 4.0, 2.0, 5.0, 3.0, 6.0]);Sourcepub fn transpose_axes(&self, perm: [usize; D]) -> Self
pub fn transpose_axes(&self, perm: [usize; D]) -> Self
Returns a new ArrTensor with axes permuted according to perm.
§Panics
- If
permis not a permutation of[0..D].
§Example
use tensor_optim::{ArrTensor, TensorOps};
let tensor = ArrTensor::<f32, 6, 2>::with_data([2, 3], [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);
let transposed = tensor.transpose_axes([1, 0]);
assert_eq!(transposed.shape(), [3, 2]);
assert_eq!(transposed.data(), [1.0, 4.0, 2.0, 5.0, 3.0, 6.0]);Sourcepub fn transpose_axes_unchecked(&self, perm: [usize; D]) -> Self
pub fn transpose_axes_unchecked(&self, perm: [usize; D]) -> Self
Permutes the axes of self assuming a valid permutation.
This is roughly equivalent, though marginally more efficient, compared
to Self::transpose_axes.
Trait Implementations§
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Add<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Add<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Add<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Add<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Add<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Add<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Add for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Add for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> AddAssign<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> AddAssign<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
+= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> AddAssign<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> AddAssign<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn add_assign(&mut self, rhs: &T)
fn add_assign(&mut self, rhs: &T)
+= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> AddAssign<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> AddAssign<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
+= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> AddAssign for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> AddAssign for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> Clone for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Clone,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Clone for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Clone,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> ConstTensorOps<T, N, D> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> ConstTensorOps<T, N, D> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn data_array(&self) -> &[T; N]
fn data_array(&self) -> &[T; N]
T. Read moreSource§fn data_mut_array(&mut self) -> &mut [T; N]
fn data_mut_array(&mut self) -> &mut [T; N]
T. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> Debug for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Debug,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Debug for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Debug,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Div<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Div<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Div<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Div<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Div<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Div<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Div for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Div for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> DivAssign<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> DivAssign<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn div_assign(&mut self, rhs: &Self)
fn div_assign(&mut self, rhs: &Self)
/= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> DivAssign<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> DivAssign<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn div_assign(&mut self, rhs: &T)
fn div_assign(&mut self, rhs: &T)
/= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> DivAssign<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> DivAssign<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
/= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> DivAssign for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> DivAssign for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> Index<&[usize]> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Index<&[usize]> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Mul<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Mul<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Mul<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Mul<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Mul<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Mul<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Mul for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Mul for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> MulAssign<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> MulAssign<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn mul_assign(&mut self, rhs: &Self)
fn mul_assign(&mut self, rhs: &Self)
*= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> MulAssign<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> MulAssign<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn mul_assign(&mut self, rhs: &T)
fn mul_assign(&mut self, rhs: &T)
*= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> MulAssign<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> MulAssign<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
*= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> MulAssign for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> MulAssign for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> Ord for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Ord,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Ord for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Ord,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> PartialEq for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + PartialEq,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> PartialEq for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + PartialEq,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> PartialOrd for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + PartialOrd,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> PartialOrd for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + PartialOrd,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Sub<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Sub<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Sub<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Sub<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Sub<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Sub<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> Sub for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Sub for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§impl<T, const N: usize, const D: usize, const LANES: usize> SubAssign<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> SubAssign<&ArrTensor<T, N, D, LANES>> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
-= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> SubAssign<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> SubAssign<&T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn sub_assign(&mut self, rhs: &T)
fn sub_assign(&mut self, rhs: &T)
-= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> SubAssign<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> SubAssign<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
-= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> SubAssign for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> SubAssign for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Default,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreSource§impl<T, const N: usize, const D: usize, const LANES: usize> TensorOps<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> TensorOps<T> for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> Eq for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive + Eq,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const N: usize, const D: usize, const LANES: usize> StructuralPartialEq for ArrTensor<T, N, D, LANES>where
T: SimdElement + Primitive,
[T; LANES]: AlignedSimd<[T; LANES], T, LANES>,
LaneCount<LANES>: SupportedLaneCount,
Auto Trait Implementations§
impl<T, const N: usize, const D: usize, const LANES: usize> Freeze for ArrTensor<T, N, D, LANES>
impl<T, const N: usize, const D: usize, const LANES: usize> RefUnwindSafe for ArrTensor<T, N, D, LANES>
impl<T, const N: usize, const D: usize, const LANES: usize> Send for ArrTensor<T, N, D, LANES>
impl<T, const N: usize, const D: usize, const LANES: usize> Sync for ArrTensor<T, N, D, LANES>
impl<T, const N: usize, const D: usize, const LANES: usize> Unpin for ArrTensor<T, N, D, LANES>
impl<T, const N: usize, const D: usize, const LANES: usize> UnwindSafe for ArrTensor<T, N, D, LANES>
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> SupersetOf<T> for T
impl<T> SupersetOf<T> for T
Source§fn from_subset(scalar: T) -> T
fn from_subset(scalar: T) -> T
scalar for all slots in an instance Self.Source§fn into_subset(self) -> T
fn into_subset(self) -> T
T from self.