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_buffer operation
in the sense that it provides a bridge between a tensor world view
and a bufferized world view. Unlike the bufferization.to_buffer
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>
pub fn builder( context: &'c Context, location: Location<'c>, ) -> ToPositionsOperationBuilder<'c, 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> Clone for ToPositionsOperation<'c>
impl<'c> Clone for ToPositionsOperation<'c>
Source§fn clone(&self) -> ToPositionsOperation<'c>
fn clone(&self) -> ToPositionsOperation<'c>
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<'c> Debug for ToPositionsOperation<'c>
impl<'c> Debug for ToPositionsOperation<'c>
Source§impl<'b> From<ToPositionsOperation<'b>> for SparseTensorDialectOperation<'b>
impl<'b> From<ToPositionsOperation<'b>> for SparseTensorDialectOperation<'b>
Source§fn from(op: ToPositionsOperation<'b>) -> Self
fn from(op: ToPositionsOperation<'b>) -> Self
Converts to this type from the input type.
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.
Source§impl<'c> PartialEq for ToPositionsOperation<'c>
impl<'c> PartialEq for ToPositionsOperation<'c>
Source§impl<'c> TryFrom<Operation<'c>> for ToPositionsOperation<'c>
impl<'c> TryFrom<Operation<'c>> for ToPositionsOperation<'c>
impl<'c> Eq for ToPositionsOperation<'c>
impl<'c> StructuralPartialEq for ToPositionsOperation<'c>
Auto Trait Implementations§
impl<'c> Freeze for ToPositionsOperation<'c>
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