Struct melior::dialect::ods::sparse_tensor::NumberOfEntriesOperation
source · pub struct NumberOfEntriesOperation<'c> { /* private fields */ }
Expand description
A number_of_entries
operation. Returns the number of entries that are stored in the tensor..
Returns the number of entries that are stored in the given sparse tensor. Note that this is typically the number of nonzero elements in the tensor, but since explicit zeros may appear in the storage formats, the more accurate nomenclature is used.
Example:
%noe = sparse_tensor.number_of_entries %tensor : tensor<64x64xf64, #CSR>
Implementations§
source§impl<'c> NumberOfEntriesOperation<'c>
impl<'c> NumberOfEntriesOperation<'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>
) -> NumberOfEntriesOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> NumberOfEntriesOperationBuilder<'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<NumberOfEntriesOperation<'c>> for Operation<'c>
impl<'c> From<NumberOfEntriesOperation<'c>> for Operation<'c>
source§fn from(operation: NumberOfEntriesOperation<'c>) -> Self
fn from(operation: NumberOfEntriesOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for NumberOfEntriesOperation<'c>
impl<'c> !Send for NumberOfEntriesOperation<'c>
impl<'c> !Sync for NumberOfEntriesOperation<'c>
impl<'c> Unpin for NumberOfEntriesOperation<'c>
impl<'c> UnwindSafe for NumberOfEntriesOperation<'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