Skip to main content

Op

Struct Op 

Source
pub struct Op(/* private fields */);
Expand description

A TOSA operator discriminant.

Constants cover the stable TOSA 1.0 operator set. Raw values above Op::CONST_SHAPE belong to schema additions newer than TOSA 1.0 and are rejected by crate::parse.

Implementations§

Source§

impl Op

Source

pub const ARGMAX: Self

Source

pub const AVG_POOL2D: Self

Source

pub const CONV2D: Self

Source

pub const CONV3D: Self

Source

pub const DEPTHWISE_CONV2D: Self

Source

pub const FFT2D: Self

Source

pub const MATMUL: Self

Source

pub const MAX_POOL2D: Self

Source

pub const RFFT2D: Self

Source

pub const TRANSPOSE_CONV2D: Self

Source

pub const CLAMP: Self

Source

pub const ERF: Self

Source

pub const SIGMOID: Self

Source

pub const TANH: Self

Source

pub const ADD: Self

Source

pub const ARITHMETIC_RIGHT_SHIFT: Self

Source

pub const BITWISE_AND: Self

Source

pub const BITWISE_OR: Self

Source

pub const BITWISE_XOR: Self

Source

pub const INTDIV: Self

Source

pub const LOGICAL_AND: Self

Source

pub const LOGICAL_LEFT_SHIFT: Self

Source

pub const LOGICAL_RIGHT_SHIFT: Self

Source

pub const LOGICAL_OR: Self

Source

pub const LOGICAL_XOR: Self

Source

pub const MAXIMUM: Self

Source

pub const MINIMUM: Self

Source

pub const MUL: Self

Source

pub const POW: Self

Source

pub const SUB: Self

Source

pub const TABLE: Self

Source

pub const ABS: Self

Source

pub const BITWISE_NOT: Self

Source

pub const CEIL: Self

Source

pub const CLZ: Self

Source

pub const COS: Self

Source

pub const EXP: Self

Source

pub const FLOOR: Self

Source

pub const LOG: Self

Source

pub const LOGICAL_NOT: Self

Source

pub const NEGATE: Self

Source

pub const RECIPROCAL: Self

Source

pub const RSQRT: Self

Source

pub const SIN: Self

Source

pub const SELECT: Self

Source

pub const EQUAL: Self

Source

pub const GREATER: Self

Source

pub const GREATER_EQUAL: Self

Source

pub const REDUCE_ALL: Self

Source

pub const REDUCE_ANY: Self

Source

pub const REDUCE_MAX: Self

Source

pub const REDUCE_MIN: Self

Source

pub const REDUCE_PRODUCT: Self

Source

pub const REDUCE_SUM: Self

Source

pub const CONCAT: Self

Source

pub const PAD: Self

Source

pub const RESHAPE: Self

Source

pub const REVERSE: Self

Source

pub const SLICE: Self

Source

pub const TILE: Self

Source

pub const TRANSPOSE: Self

Source

pub const GATHER: Self

Source

pub const SCATTER: Self

Source

pub const RESIZE: Self

Source

pub const CAST: Self

Source

pub const RESCALE: Self

Source

pub const CONST: Self

Source

pub const IDENTITY: Self

Source

pub const CUSTOM: Self

Source

pub const COND_IF: Self

Source

pub const WHILE_LOOP: Self

Source

pub const VARIABLE: Self

Source

pub const VARIABLE_WRITE: Self

Source

pub const VARIABLE_READ: Self

Source

pub const CONST_SHAPE: Self

Source

pub const ALL: &'static [Self]

Every operator in the stable TOSA 1.0 serialization set, in wire order.

Source

pub const fn new(raw: u32) -> Self

Source

pub const fn get(self) -> u32

Source

pub const fn is_tosa_1_0(self) -> bool

Source

pub fn name(self) -> Option<&'static str>

Source

pub const fn arity(self) -> Option<Arity>

Stable TOSA 1.0 serialized operand-count contract.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

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 Copy for Op

Source§

impl Debug for Op

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Op

Source§

impl Hash for Op

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Op

Source§

fn cmp(&self, other: &Op) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Op

Source§

fn eq(&self, other: &Op) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Op

Source§

fn partial_cmp(&self, other: &Op) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

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.