Struct melior::dialect::ods::sparse_tensor::ToSliceStrideOperation
source · pub struct ToSliceStrideOperation<'c> { /* private fields */ }
Expand description
A slice.stride
operation. Extracts the stride of the sparse tensor slice at the given dimension.
Extracts the stride 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][%s1, %s2] : tensor<128x128xf64, #DCSR>
to tensor<64x64xf64, #Slice>
%1 = sparse_tensor.slice.stride %0 at 0 : tensor<64x64xf64, #Slice>
%2 = sparse_tensor.slice.stride %0 at 1 : tensor<64x64xf64, #Slice>
// %1 = %s1
// %2 = %s2
Implementations§
source§impl<'c> ToSliceStrideOperation<'c>
impl<'c> ToSliceStrideOperation<'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>
) -> ToSliceStrideOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ToSliceStrideOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn stride(&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<ToSliceStrideOperation<'c>> for Operation<'c>
impl<'c> From<ToSliceStrideOperation<'c>> for Operation<'c>
source§fn from(operation: ToSliceStrideOperation<'c>) -> Self
fn from(operation: ToSliceStrideOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ToSliceStrideOperation<'c>
impl<'c> !Send for ToSliceStrideOperation<'c>
impl<'c> !Sync for ToSliceStrideOperation<'c>
impl<'c> Unpin for ToSliceStrideOperation<'c>
impl<'c> UnwindSafe for ToSliceStrideOperation<'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