pub struct ExtractOperation<'c> { /* private fields */ }
Expand description
An extract
operation. Element extraction operation.
The tensor.extract
op reads a ranked tensor and returns one element as
specified by the given indices. The result of the op is a value with the
same type as the elements of the tensor. The arity of indices must match
the rank of the accessed value. All indices should all be of index
type.
Example:
%4 = tensor.extract %t[%1, %2] : tensor<4x4xi32>
%5 = tensor.extract %rt[%1, %2] : tensor<?x?xi32>
Implementations§
source§impl<'c> ExtractOperation<'c>
impl<'c> ExtractOperation<'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>
) -> ExtractOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ExtractOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn tensor(&self) -> Result<Value<'c, '_>, Error>
pub fn indices(&self) -> impl Iterator<Item = Value<'c, '_>>
Trait Implementations§
source§impl<'c> From<ExtractOperation<'c>> for Operation<'c>
impl<'c> From<ExtractOperation<'c>> for Operation<'c>
source§fn from(operation: ExtractOperation<'c>) -> Self
fn from(operation: ExtractOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ExtractOperation<'c>
impl<'c> !Send for ExtractOperation<'c>
impl<'c> !Sync for ExtractOperation<'c>
impl<'c> Unpin for ExtractOperation<'c>
impl<'c> UnwindSafe for ExtractOperation<'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