pub struct DotGeneralConfig {
pub lhs_contracting_dims: Vec<usize>,
pub rhs_contracting_dims: Vec<usize>,
pub lhs_batch_dims: Vec<usize>,
pub rhs_batch_dims: Vec<usize>,
pub lhs_rank: usize,
pub rhs_rank: usize,
}Expand description
DotGeneral dimension configuration.
The output shape is [lhs_free..., rhs_free..., batch...] (col-major
batch-trailing convention). Batch dims have the largest stride so that
each batch slice occupies a contiguous block of memory.
§Examples
ⓘ
use tenferro_tensor::DotGeneralConfig;
let config = DotGeneralConfig {
lhs_contracting_dims: vec![1],
rhs_contracting_dims: vec![0],
lhs_batch_dims: vec![],
rhs_batch_dims: vec![],
lhs_rank: 2,
rhs_rank: 2,
};Fields§
§lhs_contracting_dims: Vec<usize>§rhs_contracting_dims: Vec<usize>§lhs_batch_dims: Vec<usize>§rhs_batch_dims: Vec<usize>§lhs_rank: usize§rhs_rank: usizeImplementations§
Source§impl DotGeneralConfig
impl DotGeneralConfig
Sourcepub fn validate_ranks(
&self,
actual_lhs_rank: usize,
actual_rhs_rank: usize,
) -> Result<(), String>
pub fn validate_ranks( &self, actual_lhs_rank: usize, actual_rhs_rank: usize, ) -> Result<(), String>
Validate that lhs_rank and rhs_rank match the actual tensor ranks.
§Examples
ⓘ
use tenferro_tensor::DotGeneralConfig;
let config = DotGeneralConfig {
lhs_contracting_dims: vec![1],
rhs_contracting_dims: vec![0],
lhs_batch_dims: vec![],
rhs_batch_dims: vec![],
lhs_rank: 2,
rhs_rank: 2,
};
config.validate_ranks(2, 2).unwrap();pub fn validate_dims(&self) -> Result<(), String>
Trait Implementations§
Source§impl Clone for DotGeneralConfig
impl Clone for DotGeneralConfig
Source§fn clone(&self) -> DotGeneralConfig
fn clone(&self) -> DotGeneralConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DotGeneralConfig
impl Debug for DotGeneralConfig
Source§impl Hash for DotGeneralConfig
impl Hash for DotGeneralConfig
Source§impl PartialEq for DotGeneralConfig
impl PartialEq for DotGeneralConfig
impl Eq for DotGeneralConfig
impl StructuralPartialEq for DotGeneralConfig
Auto Trait Implementations§
impl Freeze for DotGeneralConfig
impl RefUnwindSafe for DotGeneralConfig
impl Send for DotGeneralConfig
impl Sync for DotGeneralConfig
impl Unpin for DotGeneralConfig
impl UnsafeUnpin for DotGeneralConfig
impl UnwindSafe for DotGeneralConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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