pub struct CustomOperation<'c> { /* private fields */ }Expand description
A custom operation. Custom operator wrapper for Tosa.
Hardware implementing TOSA may choose to add additional custom operators that are not expressed in the existing TOSA operations. These operators are not expected to be portable across TOSA implementations. The input and output signatures must be expressed in the corresponding TOSA node.
operator_name is a string that tells the backend which custom operator is
being called.
domain_name is a string identifier which can help avoid name collisions on
the identifier field.
implementation_attrs is a string which is a backend and identifier specific
set of attributes to the custom operator.
input_list is the set of tensor inputs to the custom operator.
output_list is the list of tensors returned by the operator. The number of operators
is backend specific.
Example:
%out = tosa.custom %in {domain_name = "tosa_mlir_test", operator_name =
"custom_test", implementation_attrs = ""}: (tensor<10xi32>) ->
(tensor<10xi32>)Implementations§
Source§impl<'c> CustomOperation<'c>
impl<'c> CustomOperation<'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>,
) -> CustomOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c>, ) -> CustomOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn output_list(&self) -> impl Iterator<Item = OperationResult<'c, '_>>
pub fn input_list(&self) -> impl Iterator<Item = Value<'c, '_>>
pub fn operator_name(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_operator_name(&mut self, value: StringAttribute<'c>)
pub fn domain_name(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_domain_name(&mut self, value: StringAttribute<'c>)
pub fn implementation_attrs(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_implementation_attrs(&mut self, value: StringAttribute<'c>)
Trait Implementations§
Source§impl<'c> Clone for CustomOperation<'c>
impl<'c> Clone for CustomOperation<'c>
Source§fn clone(&self) -> CustomOperation<'c>
fn clone(&self) -> CustomOperation<'c>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more