pub struct ValueAsShapeOperation<'c> { /* private fields */ }
Expand description
A value_as_shape
operation. Returns value as a shape.
The operations takes a ValueShape and returns a Shape corresponding to the value. If the input value cannot be shape (e.g., not a 1D tensor of integral value representing sizes) then this propagages the error shape. E.g.,
// The following
%0 = arith.constant dense<[1,2]> : tensor<2xi32>
%shape = shape.value_as_shape %0 : tensor<2xi32> -> !shape.shape
// is equivalent to
%shape' = shape.const_shape [1, 2] : !shape.shape
This operation is the complement of shape_of
wrt ValueShape values.
Implementations§
source§impl<'c> ValueAsShapeOperation<'c>
impl<'c> ValueAsShapeOperation<'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>
) -> ValueAsShapeOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ValueAsShapeOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn arg(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<ValueAsShapeOperation<'c>> for Operation<'c>
impl<'c> From<ValueAsShapeOperation<'c>> for Operation<'c>
source§fn from(operation: ValueAsShapeOperation<'c>) -> Self
fn from(operation: ValueAsShapeOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ValueAsShapeOperation<'c>
impl<'c> !Send for ValueAsShapeOperation<'c>
impl<'c> !Sync for ValueAsShapeOperation<'c>
impl<'c> Unpin for ValueAsShapeOperation<'c>
impl<'c> UnwindSafe for ValueAsShapeOperation<'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