pub struct SortCooOperation<'c> { /* private fields */ }
Expand description

A sort_coo operation. Sorts the arrays in xs and ys lexicographically on the integral values found in the xs list.

Sparse_tensor.sort_coo is similar to sparse_tensor.sort, except that all the xs values and some ys values are put in the linear buffer xy. The optional index attribute nx provides the number of xs values in xy. When nx is not explicitly specified, its value is 1. The optional index attribute ny provides the number of ys values in xy. When ny is not explicitly specified, its value is 0. This instruction supports a more efficient way to store the COO definition in sparse tensor type.

The buffer xy should have a dimension not less than n * (nx + ny) while the buffers in ys should have a dimension not less than n. The behavior of the operator is undefined if this condition is not met.

Example:

sparse_tensor.sort_coo insertion_sort_stable %n, %x { nx = 2 : index}
  : memref<?xindex>
sparse_tensor.sort hybrid_quick_sort %n, %xy jointly %y1
  { nx = 2 : index, ny = 2 : index}
  : memref<?xi64> jointly memref<?xf32>

Implementations§

source§

impl<'c> SortCooOperation<'c>

source

pub fn name() -> &'static str

Returns a name.

source

pub fn as_operation(&self) -> &Operation<'c>

Returns a generic operation.

source

pub fn builder( context: &'c Context, location: Location<'c> ) -> SortCooOperationBuilder<'c, Unset, Unset, Unset, Unset>

Creates a builder.

source

pub fn n(&self) -> Result<Value<'c, '_>, Error>

source

pub fn xy(&self) -> Result<Value<'c, '_>, Error>

source

pub fn ys(&self) -> impl Iterator<Item = Value<'c, '_>>

source

pub fn nx(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_nx(&mut self, value: IntegerAttribute<'c>)

source

pub fn remove_nx(&mut self) -> Result<(), Error>

source

pub fn ny(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_ny(&mut self, value: IntegerAttribute<'c>)

source

pub fn remove_ny(&mut self) -> Result<(), Error>

source

pub fn algorithm(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_algorithm(&mut self, value: Attribute<'c>)

Trait Implementations§

source§

impl<'c> From<SortCooOperation<'c>> for Operation<'c>

source§

fn from(operation: SortCooOperation<'c>) -> Self

Converts to this type from the input type.
source§

impl<'c> TryFrom<Operation<'c>> for SortCooOperation<'c>

§

type Error = Error

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

fn try_from(operation: Operation<'c>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'c> RefUnwindSafe for SortCooOperation<'c>

§

impl<'c> !Send for SortCooOperation<'c>

§

impl<'c> !Sync for SortCooOperation<'c>

§

impl<'c> Unpin for SortCooOperation<'c>

§

impl<'c> UnwindSafe for SortCooOperation<'c>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.