Skip to main content

OperatorKind

Enum OperatorKind 

Source
#[non_exhaustive]
pub enum OperatorKind {
Show 44 variants MatMul, ArgMax { axis: i32, nan_mode: NanPropagationMode, }, Ceil, Floor, Clamp { min_val: [u8; 8], max_val: [u8; 8], bound_bytes: u8, nan_mode: NanPropagationMode, }, Concat { axis: i32, }, Reverse { axis: i32, }, Transpose { perms: [i32; 6], rank: u8, }, ReduceMax { axis: i32, nan_mode: NanPropagationMode, }, ReduceMin { axis: i32, nan_mode: NanPropagationMode, }, ReduceProduct { axis: i32, }, ReduceSum { axis: i32, }, MaxPool2d { kernel: [i32; 2], stride: [i32; 2], pad: [i32; 4], nan_mode: NanPropagationMode, }, Sigmoid, Tanh, Add, LogicalAnd, LogicalOr, LogicalXor, Maximum { nan_mode: NanPropagationMode, }, Minimum { nan_mode: NanPropagationMode, }, Mul, Pow, Sub, Abs, Cos, Exp, Log, LogicalNot, Negate, Reciprocal, Rsqrt, Sin, Select, Equal, Greater, GreaterEqual, Erf, Reshape, Cast, Rescale { scale32: bool, rounding_mode: RoundingMode, per_channel: bool, input_unsigned: bool, output_unsigned: bool, }, Const, Identity, ConstShape,
}

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.
§

MatMul

§

ArgMax

Fields

§axis: i32
§

Ceil

§

Floor

§

Clamp

The bounds are one scalar each in the operand’s own dtype, so they are carried as their serialized bytes (bound_bytes of each array is significant) rather than a wider type that would not represent an integer or FP8 bound faithfully.

Fields

§min_val: [u8; 8]
§max_val: [u8; 8]
§bound_bytes: u8
§

Concat

Fields

§axis: i32
§

Reverse

Fields

§axis: i32
§

Transpose

One permutation entry per dimension; rank of perms is significant.

Fields

§perms: [i32; 6]
§rank: u8
§

ReduceMax

Fields

§axis: i32
§

ReduceMin

Fields

§axis: i32
§

ReduceProduct

Fields

§axis: i32
§

ReduceSum

Fields

§axis: i32
§

MaxPool2d

Fields

§kernel: [i32; 2]
§stride: [i32; 2]
§pad: [i32; 4]
§

Sigmoid

§

Tanh

§

Add

§

LogicalAnd

§

LogicalOr

§

LogicalXor

§

Maximum

Fields

§

Minimum

Fields

§

Mul

§

Pow

§

Sub

§

Abs

§

Cos

§

Exp

§

Log

§

LogicalNot

§

Negate

§

Reciprocal

§

Rsqrt

§

Sin

§

Select

§

Equal

§

Greater

§

GreaterEqual

§

Erf

§

Reshape

§

Cast

§

Rescale

Fields

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

Const

§

Identity

§

ConstShape

Implementations§

Source§

impl OperatorKind

Source

pub const fn op(self) -> Op

Stable TOSA opcode selected by this typed variant.

Trait Implementations§

Source§

impl Clone for OperatorKind

Source§

fn clone(&self) -> OperatorKind

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 OperatorKind

Source§

impl Debug for OperatorKind

Source§

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

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

impl Eq for OperatorKind

Source§

impl PartialEq for OperatorKind

Source§

fn eq(&self, other: &OperatorKind) -> 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 StructuralPartialEq for OperatorKind

Auto Trait Implementations§

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.