Struct tract_pulse::internal::AxesMapping
pub struct AxesMapping { /* private fields */ }
Implementations§
§impl AxesMapping
impl AxesMapping
pub fn new( input_count: usize, output_count: usize, it: impl AsRef<[Axis]> ) -> Result<AxesMapping, Error>
pub fn for_numpy_matmul( rank: usize, transposing_a: bool, transposing_b: bool, transposing_c: bool ) -> Result<AxesMapping, Error>
pub fn disconnected( inputs: &[&TypedFact], outputs: &[&TypedFact] ) -> Result<AxesMapping, Error>
pub fn disconnected_for_ranks( inputs: &[usize], outputs: &[usize] ) -> Result<AxesMapping, Error>
pub fn natural( inputs: &[&TypedFact], outputs: &[&TypedFact] ) -> Result<AxesMapping, Error>
pub fn natural_for_rank( inputs: usize, outputs: usize, rank: usize ) -> Result<AxesMapping, Error>
pub fn iter_all_axes(&self) -> impl Iterator<Item = &Axis>
pub fn input_count(&self) -> usize
pub fn output_count(&self) -> usize
pub fn axis_positions( &self, io: InOut, p: impl AxisPattern ) -> Result<&[usize], Error>
pub fn rank(&self, io: InOut) -> usize
pub fn axis(&self, p: impl AxisPattern) -> Result<&Axis, Error>
pub fn axes(&self, io: InOut) -> impl Iterator<Item = &Axis>
pub fn track_axis( &self, from: impl AxisPattern, to: InOut ) -> Result<Option<usize>, Error>
pub fn renaming( self, axis: impl AxisPattern, name: char ) -> Result<AxesMapping, Error>
pub fn linking( self, target: impl AxisPattern, axis: impl AxisPattern ) -> Result<AxesMapping, Error>
pub fn check(self) -> Result<AxesMapping, Error>
pub fn available_label(&self) -> char
pub fn is_element_wise_unary(&self) -> bool
pub fn extract_sub_mapping( &self, inputs: &[usize], outputs: &[usize] ) -> Result<AxesMapping, Error>
pub fn relabel(self) -> Result<AxesMapping, Error>
pub fn remove_axis(&self, repr: char) -> Result<AxesMapping, Error>
pub fn remove_input_axis( &self, slot: usize, position: usize ) -> Result<AxesMapping, Error>
pub fn remove_output_axis( &self, slot: usize, position: usize ) -> Result<AxesMapping, Error>
pub fn with_extra_input(self, slot: usize) -> Result<AxesMapping, Error>
pub fn with_extra_axis( self, repr: char, io: InOut, position: usize ) -> Result<AxesMapping, Error>
pub fn with_extra_axis_occurency( self, axis: impl AxisPattern, io: InOut, position: usize ) -> Result<AxesMapping, Error>
pub fn translate_to_axis_ops(&self) -> Result<Vec<AxisOp, Global>, Error>
pub fn from_strs( inputs: &[impl AsRef<str>], outputs: &[impl AsRef<str>] ) -> Result<AxesMapping, Error>
pub fn to_strs(&self) -> (SmallVec<[String; 4]>, SmallVec<[String; 4]>)
pub fn change_axis_sink( &self, io: InOut, change: &AxisOp ) -> Result<Option<AxesMapping>, Error>
pub fn direct(&self, a: InOut, b: InOut) -> bool
pub fn same_layout<D>( &self, a: InOut, b: InOut, shape_a: impl AsRef<[D]>, shape_b: impl AsRef<[D]> ) -> boolwhere D: DimLike,
pub fn axis_ops_to_canonical( &self, io: InOut ) -> Result<Vec<AxisOp, Global>, Error>
pub fn view_to_canonical<D>( &self, io: InOut, view: &mut ArrayBase<ViewRepr<&D>, Dim<IxDynImpl>> ) -> Result<(), Error>
pub fn view_to_canonical_mut<D>( &self, io: InOut, view: &mut ArrayBase<ViewRepr<&mut D>, Dim<IxDynImpl>> ) -> Result<(), Error>
Trait Implementations§
§impl Clone for AxesMapping
impl Clone for AxesMapping
§fn clone(&self) -> AxesMapping
fn clone(&self) -> AxesMapping
Returns a copy 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 more§impl Debug for AxesMapping
impl Debug for AxesMapping
§impl Display for AxesMapping
impl Display for AxesMapping
§impl FromStr for AxesMapping
impl FromStr for AxesMapping
§impl Hash for AxesMapping
impl Hash for AxesMapping
§impl PartialEq<AxesMapping> for AxesMapping
impl PartialEq<AxesMapping> for AxesMapping
§fn eq(&self, other: &AxesMapping) -> bool
fn eq(&self, other: &AxesMapping) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for AxesMapping
impl StructuralEq for AxesMapping
impl StructuralPartialEq for AxesMapping
Auto Trait Implementations§
impl RefUnwindSafe for AxesMapping
impl Send for AxesMapping
impl Sync for AxesMapping
impl Unpin for AxesMapping
impl UnwindSafe for AxesMapping
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.