Struct melior::dialect::ods::sparse_tensor::ToValuesOperation
source · pub struct ToValuesOperation<'c> { /* private fields */ }
Expand description
A values
operation. Extracts numerical values array from a tensor.
Returns the values array of the sparse storage format for the given
sparse tensor, independent of the actual dimension. 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 values array from the sparse storage
scheme (either by calling a support library or through direct code).
Writing into the result of this operation is undefined behavior.
Example:
%1 = sparse_tensor.values %0 : tensor<64x64xf64, #CSR> to memref<?xf64>
Implementations§
source§impl<'c> ToValuesOperation<'c>
impl<'c> ToValuesOperation<'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>
) -> ToValuesOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ToValuesOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn tensor(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<ToValuesOperation<'c>> for Operation<'c>
impl<'c> From<ToValuesOperation<'c>> for Operation<'c>
source§fn from(operation: ToValuesOperation<'c>) -> Self
fn from(operation: ToValuesOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ToValuesOperation<'c>
impl<'c> !Send for ToValuesOperation<'c>
impl<'c> !Sync for ToValuesOperation<'c>
impl<'c> Unpin for ToValuesOperation<'c>
impl<'c> UnwindSafe for ToValuesOperation<'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