pub trait MMMInputFormat:
Downcast
+ Debug
+ DynHash
+ DynClone
+ Send
+ Sync
+ Display {
// Required methods
fn prepare_tensor(
&self,
t: &Tensor,
k_axis: usize,
mn_axis: usize,
) -> Result<Tensor, Error>;
fn prepare_one(
&self,
t: &Tensor,
k_axis: usize,
mn_axis: usize,
) -> Result<Box<dyn MMMInputValue>, Error>;
fn precursor(&self) -> WeightType;
fn r(&self) -> usize;
fn k_alignment(&self) -> usize;
fn same_as(&self, other: &(dyn MMMInputFormat + 'static)) -> bool;
fn mem_size(&self, k: TDim, mn: TDim) -> TDim;
fn extract_at_mn_f16(
&self,
data: &EagerPackedInput,
mn: usize,
slice: &mut [f16],
) -> Result<(), Error>;
fn extract_at_mn_f32(
&self,
data: &EagerPackedInput,
mn: usize,
slice: &mut [f32],
) -> Result<(), Error>;
// Provided method
fn merge_with<'o, 'a, 'b>(
&'a self,
other: &'b (dyn MMMInputFormat + 'static),
) -> Option<&'o (dyn MMMInputFormat + 'static)>
where 'a: 'o,
'b: 'o { ... }
}Required Methods§
fn prepare_tensor( &self, t: &Tensor, k_axis: usize, mn_axis: usize, ) -> Result<Tensor, Error>
fn prepare_one( &self, t: &Tensor, k_axis: usize, mn_axis: usize, ) -> Result<Box<dyn MMMInputValue>, Error>
fn precursor(&self) -> WeightType
fn r(&self) -> usize
fn k_alignment(&self) -> usize
fn same_as(&self, other: &(dyn MMMInputFormat + 'static)) -> bool
fn mem_size(&self, k: TDim, mn: TDim) -> TDim
fn extract_at_mn_f16( &self, data: &EagerPackedInput, mn: usize, slice: &mut [f16], ) -> Result<(), Error>
fn extract_at_mn_f32( &self, data: &EagerPackedInput, mn: usize, slice: &mut [f32], ) -> Result<(), Error>
Provided Methods§
fn merge_with<'o, 'a, 'b>(
&'a self,
other: &'b (dyn MMMInputFormat + 'static),
) -> Option<&'o (dyn MMMInputFormat + 'static)>where
'a: 'o,
'b: 'o,
Implementations§
Source§impl dyn MMMInputFormat
impl dyn MMMInputFormat
Sourcepub fn is<__T>(&self) -> boolwhere
__T: MMMInputFormat,
pub fn is<__T>(&self) -> boolwhere
__T: MMMInputFormat,
Returns true if the trait object wraps an object of type __T.
Sourcepub fn downcast<__T>(
self: Box<dyn MMMInputFormat>,
) -> Result<Box<__T>, Box<dyn MMMInputFormat>>where
__T: MMMInputFormat,
pub fn downcast<__T>(
self: Box<dyn MMMInputFormat>,
) -> Result<Box<__T>, Box<dyn MMMInputFormat>>where
__T: MMMInputFormat,
Returns a boxed object from a boxed trait object if the underlying object is of type
__T. Returns the original boxed trait if it isn’t.
Sourcepub fn downcast_rc<__T>(
self: Rc<dyn MMMInputFormat>,
) -> Result<Rc<__T>, Rc<dyn MMMInputFormat>>where
__T: MMMInputFormat,
pub fn downcast_rc<__T>(
self: Rc<dyn MMMInputFormat>,
) -> Result<Rc<__T>, Rc<dyn MMMInputFormat>>where
__T: MMMInputFormat,
Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of
type __T. Returns the original Rc-ed trait if it isn’t.
Sourcepub fn downcast_ref<__T>(&self) -> Option<&__T>where
__T: MMMInputFormat,
pub fn downcast_ref<__T>(&self) -> Option<&__T>where
__T: MMMInputFormat,
Returns a reference to the object within the trait object if it is of type __T, or
None if it isn’t.
Sourcepub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>where
__T: MMMInputFormat,
pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>where
__T: MMMInputFormat,
Returns a mutable reference to the object within the trait object if it is of type
__T, or None if it isn’t.
Trait Implementations§
Source§impl<'clone> Clone for Box<dyn MMMInputFormat + 'clone>
impl<'clone> Clone for Box<dyn MMMInputFormat + 'clone>
Source§fn clone(&self) -> Box<dyn MMMInputFormat + 'clone>
fn clone(&self) -> Box<dyn MMMInputFormat + 'clone>
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 From<&(dyn MMMInputFormat + 'static)> for WeightType
impl From<&(dyn MMMInputFormat + 'static)> for WeightType
Source§fn from(value: &(dyn MMMInputFormat + 'static)) -> WeightType
fn from(value: &(dyn MMMInputFormat + 'static)) -> WeightType
Converts to this type from the input type.
Source§impl<'hash> Hash for dyn MMMInputFormat + 'hash
impl<'hash> Hash for dyn MMMInputFormat + 'hash
Source§impl<'hash> Hash for dyn MMMInputFormat + Send + 'hash
impl<'hash> Hash for dyn MMMInputFormat + Send + 'hash
Source§impl<'hash> Hash for dyn MMMInputFormat + Sync + 'hash
impl<'hash> Hash for dyn MMMInputFormat + Sync + 'hash
Source§impl PartialEq for &(dyn MMMInputFormat + 'static)
impl PartialEq for &(dyn MMMInputFormat + 'static)
Source§fn eq(&self, other: &&(dyn MMMInputFormat + 'static)) -> bool
fn eq(&self, other: &&(dyn MMMInputFormat + 'static)) -> bool
Tests for
self and other values to be equal, and is used by ==.