Skip to main content

OpAttributes

Enum OpAttributes 

Source
#[non_exhaustive]
pub enum OpAttributes<'a> {
Show 28 variants Empty { op: Op, }, ArgMax { axis: i32, nan_mode: NanPropagationMode, }, AvgPool2d { kernel: I32List<'a>, stride: I32List<'a>, pad: I32List<'a>, acc_type: DType, }, Conv2d { pad: I32List<'a>, stride: I32List<'a>, dilation: I32List<'a>, local_bound: bool, acc_type: DType, }, Conv3d { pad: I32List<'a>, stride: I32List<'a>, dilation: I32List<'a>, local_bound: bool, acc_type: DType, }, DepthwiseConv2d { pad: I32List<'a>, stride: I32List<'a>, dilation: I32List<'a>, local_bound: bool, acc_type: DType, }, Fft2d { inverse: bool, local_bound: bool, }, MaxPool2d { kernel: I32List<'a>, stride: I32List<'a>, pad: I32List<'a>, nan_mode: NanPropagationMode, }, Rfft2d { local_bound: bool, }, TransposeConv2d { out_pad: I32List<'a>, stride: I32List<'a>, local_bound: bool, acc_type: DType, }, Clamp { min_val: &'a [u8], max_val: &'a [u8], nan_mode: NanPropagationMode, }, ArithmeticRightShift { round: bool, }, Maximum { nan_mode: NanPropagationMode, }, Minimum { nan_mode: NanPropagationMode, }, ReduceAll { axis: i32, }, ReduceAny { axis: i32, }, ReduceMax { axis: i32, nan_mode: NanPropagationMode, }, ReduceMin { axis: i32, nan_mode: NanPropagationMode, }, ReduceProduct { axis: i32, }, ReduceSum { axis: i32, }, Concat { axis: i32, }, Reverse { axis: i32, }, Transpose { perms: I32List<'a>, }, Resize { mode: ResizeMode, }, Rescale { scale32: bool, rounding_mode: RoundingMode, per_channel: bool, input_unsigned: bool, output_unsigned: bool, }, Custom { operator_name: Option<&'a str>, domain_name: Option<&'a str>, implementation_attrs: &'a [u8], }, CondIf { then_graph: Option<&'a str>, else_graph: Option<&'a str>, }, WhileLoop { cond_graph: Option<&'a str>, body_graph: Option<&'a str>, },
}
Expand description

Safe, exhaustive view of the attribute payload used by a stable TOSA 1.0 operator.

Operators whose schema table has no fields return Self::Empty; Self::Empty::op still identifies the exact table. Vector fields remain borrowed and are decoded without allocation.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Empty

Fields

§op: Op
§

ArgMax

Fields

§axis: i32
§

AvgPool2d

Fields

§kernel: I32List<'a>
§stride: I32List<'a>
§pad: I32List<'a>
§acc_type: DType
§

Conv2d

Fields

§pad: I32List<'a>
§stride: I32List<'a>
§dilation: I32List<'a>
§local_bound: bool
§acc_type: DType
§

Conv3d

Fields

§pad: I32List<'a>
§stride: I32List<'a>
§dilation: I32List<'a>
§local_bound: bool
§acc_type: DType
§

DepthwiseConv2d

Fields

§pad: I32List<'a>
§stride: I32List<'a>
§dilation: I32List<'a>
§local_bound: bool
§acc_type: DType
§

Fft2d

Fields

§inverse: bool
§local_bound: bool
§

MaxPool2d

Fields

§kernel: I32List<'a>
§stride: I32List<'a>
§pad: I32List<'a>
§

Rfft2d

Fields

§local_bound: bool
§

TransposeConv2d

Fields

§out_pad: I32List<'a>
§stride: I32List<'a>
§local_bound: bool
§acc_type: DType
§

Clamp

Fields

§min_val: &'a [u8]
§max_val: &'a [u8]
§

ArithmeticRightShift

Fields

§round: bool
§

Maximum

Fields

§

Minimum

Fields

§

ReduceAll

Fields

§axis: i32
§

ReduceAny

Fields

§axis: i32
§

ReduceMax

Fields

§axis: i32
§

ReduceMin

Fields

§axis: i32
§

ReduceProduct

Fields

§axis: i32
§

ReduceSum

Fields

§axis: i32
§

Concat

Fields

§axis: i32
§

Reverse

Fields

§axis: i32
§

Transpose

Fields

§perms: I32List<'a>
§

Resize

Fields

§

Rescale

Fields

§scale32: bool
§rounding_mode: RoundingMode
§per_channel: bool
§input_unsigned: bool
§output_unsigned: bool
§

Custom

Fields

§operator_name: Option<&'a str>
§domain_name: Option<&'a str>
§implementation_attrs: &'a [u8]
§

CondIf

Fields

§then_graph: Option<&'a str>
§else_graph: Option<&'a str>
§

WhileLoop

Fields

§cond_graph: Option<&'a str>
§body_graph: Option<&'a str>

Trait Implementations§

Source§

impl<'a> Clone for OpAttributes<'a>

Source§

fn clone(&self) -> OpAttributes<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for OpAttributes<'a>

Source§

impl<'a> Debug for OpAttributes<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for OpAttributes<'a>

§

impl<'a> RefUnwindSafe for OpAttributes<'a>

§

impl<'a> Send for OpAttributes<'a>

§

impl<'a> Sync for OpAttributes<'a>

§

impl<'a> Unpin for OpAttributes<'a>

§

impl<'a> UnsafeUnpin for OpAttributes<'a>

§

impl<'a> UnwindSafe for OpAttributes<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.