Mojo struct
Conv2dProblemShape
struct Conv2dProblemShape
Defines 2D convolution problem geometry.
Layouts:
- Activation: NHWC (batch, height, width, channels)
- Filter: KRSC (output_channels, filter_h, filter_s, input_channels)
- Output: NHWC (batch, out_height, out_width, output_channels)
For Fprop with stride=1, no dilation, this maps to GEMM as:
- M = N * H_out * W_out
- N = K (output channels)
- K = C * R * S (input channels * filter area)
Fieldsβ
- βbatch (
Int): - βin_height (
Int): - βin_width (
Int): - βin_channels (
Int): - βout_channels (
Int): - βfilter_h (
Int): - βfilter_w (
Int): - βpad_h (
Int): - βpad_w (
Int): - βstride_h (
Int): - βstride_w (
Int): - βdilation_h (
Int): - βdilation_w (
Int): - βgroups (
Int):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyDestructible,
Movable
Methodsβ
__init__β
__init__(out self, batch: Int, in_height: Int, in_width: Int, in_channels: Int, out_channels: Int, filter_h: Int, filter_w: Int, pad_h: Int = 0, pad_w: Int = 0, stride_h: Int = 1, stride_w: Int = 1, dilation_h: Int = 1, dilation_w: Int = 1, groups: Int = 1)
out_heightβ
out_widthβ
gemm_mβ
gemm_nβ
gemm_kβ
num_m_tilesβ
num_n_tilesβ
num_k_tilesβ
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!