Skip to main content

Module module

Module module 

Source
Expand description

The neural network module.

Functions§

adaptive_avg_pool1d
Applies a 1D adaptive avg pooling.
adaptive_avg_pool2d
Applies a 2D adaptive avg pooling.
attention
Computes scaled dot-product attention: softmax(QKᵗ * scale) · V, where scale defaults to 1/sqrt(head_dim) (configurable via options.scale). Optionally applies masking, additive bias, causal masking, and softcap.
attention_fallback
Exports attention fallback to test backend’s attention against.
avg_pool1d
Applies a 1D avg pooling.
avg_pool2d
Applies a 2D avg pooling.
conv1d
Applies a 1D convolution.
conv2d
Applies a 2D convolution.
conv3d
Applies a 3D convolution.
conv_transpose1d
Applies a 1D transposed convolution.
conv_transpose2d
Applies a 2D transposed convolution.
conv_transpose3d
Applies a 3D transposed convolution](crate::ops::ModuleOps::conv_transpose3d).
ctc_loss
Computes the CTC loss.
deform_conv2d
Applies a Deformable 2D convolution.
embedding
Applies the embedding module.
interpolate
Applies a 2D interpolation.
linear
Applies a linear transformation to the input tensor using the given weight and bias.
max_pool1d
Applies a 1D max pooling.
max_pool1d_with_indices
Applies a 1D max pooling.
max_pool2d
Applies a 2D max pooling.
max_pool2d_with_indices
Applies a 2D max pooling with indices.
unfold4d
Applies a 4D to 3D unfold.