Struct melior::dialect::ods::sparse_tensor::ToSliceOffsetOperation
source · pub struct ToSliceOffsetOperation<'c> { /* private fields */ }
Expand description
A slice.offset
operation. Extracts the offset of the sparse tensor slice at the given dimension.
Extracts the offset of the sparse tensor slice at the given dimension.
Currently, sparse tensor slices are still a work in progress, and only
works when runtime library is disabled (i.e., running sparse compiler
with enable-runtime-library=false
).
Example:
%0 = tensor.extract_slice %s[%v1, %v2][64, 64][1, 1] : tensor<128x128xf64, #DCSR>
to tensor<64x64xf64, #Slice>
%1 = sparse_tensor.slice.offset %0 at 0 : tensor<64x64xf64, #Slice>
%2 = sparse_tensor.slice.offset %0 at 1 : tensor<64x64xf64, #Slice>
// %1 = %v1
// %2 = %v2
Implementations§
source§impl<'c> ToSliceOffsetOperation<'c>
impl<'c> ToSliceOffsetOperation<'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>
) -> ToSliceOffsetOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ToSliceOffsetOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn offset(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn slice(&self) -> Result<Value<'c, '_>, Error>
pub fn dim(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_dim(&mut self, value: IntegerAttribute<'c>)
Trait Implementations§
source§impl<'c> From<ToSliceOffsetOperation<'c>> for Operation<'c>
impl<'c> From<ToSliceOffsetOperation<'c>> for Operation<'c>
source§fn from(operation: ToSliceOffsetOperation<'c>) -> Self
fn from(operation: ToSliceOffsetOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ToSliceOffsetOperation<'c>
impl<'c> !Send for ToSliceOffsetOperation<'c>
impl<'c> !Sync for ToSliceOffsetOperation<'c>
impl<'c> Unpin for ToSliceOffsetOperation<'c>
impl<'c> UnwindSafe for ToSliceOffsetOperation<'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