API Reference#

This section contains the API reference for the Warp-NN library.

Core modules#

Buffer

Class representing a non-learnable state array (e.g. running statistics).

Module

Base abstract class for all the modules.

Parameter

Class representing a learnable parameter.

Activations#

CELU

Continuously differentiable Exponential Linear Unit (CELU) activation function.

ELU

Exponential Linear Unit (ELU) activation function.

GELU

Gaussian Error Linear Unit (GELU) activation function.

HardSigmoid

Hard Sigmoid activation function.

HardSwish

Hard Swish (HardSwish) activation function.

LeakyReLU

Leaky Rectified Linear Unit (Leaky ReLU) activation function.

LogSoftmax

Log-Softmax activation function.

Mish

Mish activation function.

PReLU

Parametric ReLU (PReLU) operation.

ReLU

Rectified Linear Unit (ReLU) activation function.

SELU

Scaled Exponential Linear Unit (SELU) activation function.

Shrink

Shrink activation function.

Sigmoid

Sigmoid activation function.

Softmax

Softmax activation function.

Softplus

Softplus activation function.

Softsign

Softsign activation function.

Swish

Swish activation function.

Threshold

Threshold activation function.

Initializers#

constant

Initialize the array with a constant value.

kaiming_normal

Initialize the array using the Kaiming (aka He) normal initialization method.

kaiming_uniform

Initialize the array using the Kaiming (aka He) uniform initialization method.

ones

Initialize the array with ones.

zeros

Initialize the array with zeros.

Layers#

AvgPool1D

Apply a 1D average pooling.

AvgPool2D

Apply a 2D average pooling.

BatchNorm

Apply Batch Normalization over the channels of the input.

Conv1D

Apply a 1D convolution.

Conv2D

Apply a 2D convolution.

Dropout

Randomly zero some of the input values during training.

Flatten

Flatten a contiguous range of dimensions into a single dimension.

GlobalAvgPool

Apply a global average pooling over the spatial dimensions of the input.

GlobalMaxPool

Apply a global max pooling over the spatial dimensions of the input.

GroupNorm

Apply Group Normalization over the channels of the input.

GRU

Apply a multi-layer Gated Recurrent Unit (GRU) to an input sequence.

GRUCell

Apply a Gated Recurrent Unit (GRU) cell.

Identity

Identity operation.

InstanceNorm

Apply Instance Normalization over the spatial dimensions of the input.

LayerNorm

Apply Layer Normalization over the trailing dimensions of the input.

Linear

Apply a linear transformation over the final dimension of the input.

LSTM

Apply a multi-layer Long Short-Term Memory (LSTM) to an input sequence.

LSTMCell

Apply a Long Short-Term Memory (LSTM) cell.

MaxPool1D

Apply a 1D max pooling.

MaxPool2D

Apply a 2D max pooling.

RMSNorm

Apply Root Mean Square (RMS) Normalization over the trailing dimensions of the input.

RNN

Apply a multi-layer Elman's Recurrent Neural Network (RNN) to an input sequence.

RNNCell

Apply a Elman's Recurrent Neural Network (RNN) cell.

Sequential

Apply callable modules (e.g. layers, activation functions, etc.) connected in a cascading sequence.

Operators#

Abs

Absolute Value (Abs) operation.

Acos

Arccosine (Acos) operation.

Acosh

Inverse Hyperbolic Cosine (Acosh) operation.

Add

Addition (Add) operation.

Asin

Arcsine (Asin) operation.

Asinh

Inverse Hyperbolic Sine (Asinh) operation.

Atan

Arctangent (Atan) operation.

Atanh

Inverse Hyperbolic Tangent (Atanh) operation.

BitwiseAnd

Bitwise AND (BitwiseAnd) operation.

BitwiseNot

Bitwise NOT (BitwiseNot) operation.

BitwiseOr

Bitwise OR (BitwiseOr) operation.

BitwiseXor

Bitwise XOR (BitwiseXor) operation.

Ceil

Ceiling (Ceil) operation.

Clip

Element-wise clipping (clamping) of the input values into the interval [min_val, max_val].

Cos

Cosine (Cos) operation.

Cosh

Hyperbolic Cosine (Cosh) operation.

Div

Division (Div) operation.

Erf

Error Function (Erf) operation.

Exp

Exponential (Exp) operation.

Floor

Floor operation.

Log

Natural Logarithm (Log) operation.

Max

Element-wise maximum (Max) operation.

Min

Element-wise minimum (Min) operation.

Mul

Multiplication (Mul) operation.

Neg

Negation (Neg) operation.

Pow

Power (Pow) operation.

Reciprocal

Reciprocal operation.

Round

Round operation.

Sign

Sign operation.

Sin

Sine (Sin) operation.

Sinh

Hyperbolic Sine (Sinh) operation.

Sqrt

Square Root (Sqrt) operation.

Sub

Subtraction (Sub) operation.

Tan

Tangent (Tan) operation.

Tanh

Hyperbolic Tangent (Tanh) operation.

Optimizers#

Adam

Adam optimizer.

SGD

SGD optimizer.

Runtime#

OnnxRuntime

Execute an ONNX graph using Warp-NN modules.