Struct melior::dialect::ods::sparse_tensor::ToPositionsOperation
source · pub struct ToPositionsOperation<'c> { /* private fields */ }
Expand description
A positions
operation. Extracts the level
-th positions array of the tensor
.
Returns the positions array of the tensor’s storage at the given
level. This is similar to the bufferization.to_memref
operation
in the sense that it provides a bridge between a tensor world view
and a bufferized world view. Unlike the bufferization.to_memref
operation, however, this sparse operation actually lowers into code
that extracts the positions array from the sparse storage itself
(either by calling a support library or through direct code).
Writing into the result of this operation is undefined behavior.
Example:
%1 = sparse_tensor.positions %0 { level = 1 : index }
: tensor<64x64xf64, #CSR> to memref<?xindex>
Implementations§
source§impl<'c> ToPositionsOperation<'c>
impl<'c> ToPositionsOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> ToPositionsOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ToPositionsOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn tensor(&self) -> Result<Value<'c, '_>, Error>
pub fn level(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_level(&mut self, value: IntegerAttribute<'c>)
Trait Implementations§
source§impl<'c> From<ToPositionsOperation<'c>> for Operation<'c>
impl<'c> From<ToPositionsOperation<'c>> for Operation<'c>
source§fn from(operation: ToPositionsOperation<'c>) -> Self
fn from(operation: ToPositionsOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ToPositionsOperation<'c>
impl<'c> !Send for ToPositionsOperation<'c>
impl<'c> !Sync for ToPositionsOperation<'c>
impl<'c> Unpin for ToPositionsOperation<'c>
impl<'c> UnwindSafe for ToPositionsOperation<'c>
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