pub struct ReinterpretMapOperation<'c> { /* private fields */ }Expand description
A reinterpret_map operation. Reinterprets the dimension/level maps of the source tensor.
Reinterprets the dimension-to-level and level-to-dimension map specified in
source according to the type of dest.
reinterpret_map is a no-op and is introduced merely to resolve type conflicts.
It does not make any modification to the source tensor and source/dest tensors
are considered to be aliases.
source and dest tensors are “reinterpretable” if and only if they have
the exactly same storage at a low level.
That is, both source and dest has the same number of levels and level types,
and their shape is consistent before and after reinterpret_map.
Example:
#CSC = #sparse_tensor.encoding<{
map = (d0, d1) -> (d1: dense, d0: compressed)
}>
#CSR = #sparse_tensor.encoding<{
map = (d0, d1) -> (d0: dense, d1: compressed)
}>
%t1 = sparse_tensor.reinterpret_map %t0 : tensor<3x4xi32, #CSC> to tensor<4x3xi32, #CSR>
#BSR = #sparse_tensor.encoding<{
map = ( i, j ) -> ( i floordiv 2 : dense,
j floordiv 3 : compressed,
i mod 2 : dense,
j mod 3 : dense
)
}>
#DSDD = #sparse_tensor.encoding<{
map = (i, j, k, l) -> (i: dense, j: compressed, k: dense, l: dense)
}>
%t1 = sparse_tensor.reinterpret_map %t0 : tensor<6x12xi32, #BSR> to tensor<3x4x2x3xi32, #DSDD>Implementations§
Source§impl<'c> ReinterpretMapOperation<'c>
impl<'c> ReinterpretMapOperation<'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>,
) -> ReinterpretMapOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c>, ) -> ReinterpretMapOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn dest(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn source(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
Source§impl<'c> Clone for ReinterpretMapOperation<'c>
impl<'c> Clone for ReinterpretMapOperation<'c>
Source§fn clone(&self) -> ReinterpretMapOperation<'c>
fn clone(&self) -> ReinterpretMapOperation<'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 ReinterpretMapOperation<'c>
impl<'c> Debug for ReinterpretMapOperation<'c>
Source§impl<'b> From<ReinterpretMapOperation<'b>> for SparseTensorDialectOperation<'b>
impl<'b> From<ReinterpretMapOperation<'b>> for SparseTensorDialectOperation<'b>
Source§fn from(op: ReinterpretMapOperation<'b>) -> Self
fn from(op: ReinterpretMapOperation<'b>) -> Self
Converts to this type from the input type.
Source§impl<'c> From<ReinterpretMapOperation<'c>> for Operation<'c>
impl<'c> From<ReinterpretMapOperation<'c>> for Operation<'c>
Source§fn from(operation: ReinterpretMapOperation<'c>) -> Self
fn from(operation: ReinterpretMapOperation<'c>) -> Self
Converts to this type from the input type.
Source§impl<'c> PartialEq for ReinterpretMapOperation<'c>
impl<'c> PartialEq for ReinterpretMapOperation<'c>
Source§impl<'c> TryFrom<Operation<'c>> for ReinterpretMapOperation<'c>
impl<'c> TryFrom<Operation<'c>> for ReinterpretMapOperation<'c>
impl<'c> Eq for ReinterpretMapOperation<'c>
impl<'c> StructuralPartialEq for ReinterpretMapOperation<'c>
Auto Trait Implementations§
impl<'c> Freeze for ReinterpretMapOperation<'c>
impl<'c> RefUnwindSafe for ReinterpretMapOperation<'c>
impl<'c> !Send for ReinterpretMapOperation<'c>
impl<'c> !Sync for ReinterpretMapOperation<'c>
impl<'c> Unpin for ReinterpretMapOperation<'c>
impl<'c> UnwindSafe for ReinterpretMapOperation<'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