pub struct ConstantOperation<'c> { /* private fields */ }
Expand description
A constant
operation. Constant.
The func.constant
operation produces an SSA value from a symbol reference
to a func.func
operation
Example:
// Reference to function @myfn.
%2 = func.constant @myfn : (tensor<16xf32>, f32) -> tensor<16xf32>
// Equivalent generic forms
%2 = "func.constant"() { value = @myfn } : () -> ((tensor<16xf32>, f32) -> tensor<16xf32>)
MLIR does not allow direct references to functions in SSA operands because the compiler is multithreaded, and disallowing SSA values to directly reference a function simplifies this (rationale).
Implementations§
source§impl<'c> ConstantOperation<'c>
impl<'c> ConstantOperation<'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>
) -> ConstantOperationBuilder<'c, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ConstantOperationBuilder<'c, Unset>
Creates a builder.
pub fn value(&self) -> Result<FlatSymbolRefAttribute<'c>, Error>
pub fn set_value(&mut self, value: FlatSymbolRefAttribute<'c>)
Trait Implementations§
source§impl<'c> From<ConstantOperation<'c>> for Operation<'c>
impl<'c> From<ConstantOperation<'c>> for Operation<'c>
source§fn from(operation: ConstantOperation<'c>) -> Self
fn from(operation: ConstantOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ConstantOperation<'c>
impl<'c> !Send for ConstantOperation<'c>
impl<'c> !Sync for ConstantOperation<'c>
impl<'c> Unpin for ConstantOperation<'c>
impl<'c> UnwindSafe for ConstantOperation<'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