For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
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,
ImplicitlyDeletable,
Movable
Methodsβ
__init__β
def __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 = Int(0), pad_w: Int = Int(0), stride_h: Int = Int(1), stride_w: Int = Int(1), dilation_h: Int = Int(1), dilation_w: Int = Int(1), groups: Int = Int(1))
out_heightβ
out_widthβ
gemm_mβ
gemm_nβ
gemm_kβ
def gemm_k(self) -> Int
GEMM K dimension = input_channels * filter_height * filter_width.
Returns:
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!