Skip to main content

NirNode

Enum NirNode 

Source
pub enum NirNode {
Show 19 variants Input(Input), Output(Output), Affine(Affine), Linear(Linear), Scale(Scale), Conv1d(Conv1d), Conv2d(Conv2d), CubaLi(CubaLi), CubaLif(CubaLif), Delay(Delay), Flatten(Flatten), I(I), If(If), Li(Li), Lif(Lif), SumPool2d(SumPool2d), AvgPool2d(AvgPool2d), Threshold(Threshold), Graph(Box<NirGraph>),
}
Expand description

Closed set of NIR computational nodes.

Exhaustive matching is intentional so downstream tools can cover every wire type. This enum is not #[non_exhaustive] so downstream mappers can cover all wire types without a wildcard arm (new wire types are a major API change). With the serde feature, the representation is internally tagged by "type"; every tag is explicitly renamed to Self::type_name.

Variants§

§

Input(Input)

Graph input port (type = "Input").

§

Output(Output)

Graph output port (type = "Output").

§

Affine(Affine)

Affine transform y = W x + b (type = "Affine").

§

Linear(Linear)

Linear transform without bias (type = "Linear").

§

Scale(Scale)

Elementwise scale (type = "Scale").

§

Conv1d(Conv1d)

1-D convolution (type = "Conv1d").

§

Conv2d(Conv2d)

2-D convolution (type = "Conv2d").

§

CubaLi(CubaLi)

Current-based leaky integrator (type = "CubaLI").

§

CubaLif(CubaLif)

Current-based LIF (type = "CubaLIF").

§

Delay(Delay)

Pure delay (type = "Delay").

§

Flatten(Flatten)

Flatten (type = "Flatten").

§

I(I)

Integrator (type = "I").

§

If(If)

Integrate-and-fire (type = "IF").

§

Li(Li)

Leaky integrator (type = "LI").

§

Lif(Lif)

Leaky integrate-and-fire (type = "LIF").

§

SumPool2d(SumPool2d)

Sum pooling 2-D (type = "SumPool2d").

§

AvgPool2d(AvgPool2d)

Average pooling 2-D (type = "AvgPool2d").

§

Threshold(Threshold)

Heaviside threshold (type = "Threshold").

§

Graph(Box<NirGraph>)

Nested subgraph (type = "NIRGraph").

Implementations§

Source§

impl NirNode

Source

pub fn type_name(&self) -> &'static str

Exact upstream HDF5 / Python wire type string.

Trait Implementations§

Source§

impl Clone for NirNode

Source§

fn clone(&self) -> NirNode

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 Debug for NirNode

Source§

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

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

impl PartialEq for NirNode

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NirNode

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.