Skip to main content

ConvKind

Enum ConvKind 

Source
#[non_exhaustive]
#[repr(u16)]
pub enum ConvKind {
Show 25 variants Conv2d = 0, Conv2dBackwardData = 1, Conv2dBackwardFilter = 2, Conv1d = 3, Conv1dBackwardData = 4, Conv1dBackwardFilter = 5, Conv3d = 6, Conv3dBackwardData = 7, Conv3dBackwardFilter = 8, ConvTranspose2d = 9, ConvTranspose2dBackward = 10, DepthwiseConv2d = 11, Unfold = 12, Fold = 13, ConvTranspose1d = 14, ConvTranspose1dBackwardData = 15, ConvTranspose1dBackwardFilter = 16, ConvTranspose2dBackwardData = 17, ConvTranspose2dBackwardFilter = 18, ConvTranspose3d = 19, ConvTranspose3dBackwardData = 20, ConvTranspose3dBackwardFilter = 21, Im2Col2d = 22, Im2Col1d = 23, Col2Im1d = 24,
}
Expand description

Convolution-family op discriminant — Category I from the comprehensive plan.

Stored as u16 in crate::KernelSku::op when category == OpCategory::Convolution. Each variant maps to a distinct cuDNN exec path (forward, data-gradient, filter-gradient) of the underlying convolution descriptor. The dimensional axis (1-D / 2-D / 3-D), padding / stride / dilation, and depthwise / transposed flavors live on the per-plan descriptor — they don’t fan out a separate enum slot here.

Today wired: Conv2d × {f32, f64, f16, bf16} (FW + BW data + BW filter) via cuDNN. Conv1d / Conv3d / ConvTranspose* / depthwise / unfold / fold are reserved discriminants for fanout milestones.

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

Conv2d = 0

2-D convolution forward pass. PyTorch torch.nn.functional.conv2d. Trailblazer for Phase 7.

§

Conv2dBackwardData = 1

2-D convolution data-gradient pass (computes dx from dy and the filter w). PyTorch’s autograd-internal conv2d_backward_input.

§

Conv2dBackwardFilter = 2

2-D convolution filter-gradient pass (computes dw from x and dy). PyTorch’s autograd-internal conv2d_backward_weight.

§

Conv1d = 3

1-D convolution forward. Reserved.

§

Conv1dBackwardData = 4

1-D convolution data-gradient. Reserved.

§

Conv1dBackwardFilter = 5

1-D convolution filter-gradient. Reserved.

§

Conv3d = 6

3-D convolution forward. Reserved.

§

Conv3dBackwardData = 7

3-D convolution data-gradient. Reserved.

§

Conv3dBackwardFilter = 8

3-D convolution filter-gradient. Reserved.

§

ConvTranspose2d = 9

2-D transposed convolution (fractionally-strided / “deconv”). Forward pass.

§

ConvTranspose2dBackward = 10

2-D transposed convolution backward. Reserved — backward is dispatched through the same plan via run_bw_data / run_dw.

§

DepthwiseConv2d = 11

Depthwise 2-D convolution (groups == c_in). Today callers route through the generic Conv2dPlan with groups set on the descriptor — cuDNN’s cudnnSetConvolutionGroupCount detects the depthwise path automatically.

§

Unfold = 12

torch.nn.functional.unfold — extract sliding windows. Reserved.

§

Fold = 13

torch.nn.functional.fold — inverse of unfold. Reserved.

§

ConvTranspose1d = 14

1-D transposed convolution forward.

§

ConvTranspose1dBackwardData = 15

1-D transposed convolution data-gradient.

§

ConvTranspose1dBackwardFilter = 16

1-D transposed convolution filter-gradient.

§

ConvTranspose2dBackwardData = 17

2-D transposed convolution data-gradient.

§

ConvTranspose2dBackwardFilter = 18

2-D transposed convolution filter-gradient.

§

ConvTranspose3d = 19

3-D transposed convolution forward.

§

ConvTranspose3dBackwardData = 20

3-D transposed convolution data-gradient.

§

ConvTranspose3dBackwardFilter = 21

3-D transposed convolution filter-gradient.

§

Im2Col2d = 22

2-D im2col — torch.nn.functional.unfold (Phase 19.3). Extracts sliding windows from an NCHW input into an [N, C·kh·kw, h_out·w_out] column-shaped matrix. Distinct from the reserved Self::Unfold discriminant for forward-source- compat; the 19.3 wiring routes through this discriminant.

§

Im2Col1d = 23

1-D im2col (NCL → [N, C·kl, l_out]).

§

Col2Im1d = 24

1-D col2im — inverse of Self::Im2Col1d. Atomic-add scatter.

Trait Implementations§

Source§

impl Clone for ConvKind

Source§

fn clone(&self) -> ConvKind

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 ConvKind

Source§

impl Debug for ConvKind

Source§

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

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

impl Eq for ConvKind

Source§

impl Hash for ConvKind

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 PartialEq for ConvKind

Source§

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

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.