For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo struct
ConvShape
struct ConvShape[rank: Int]
A shape struct describing the convolution dimensions.
Parameters
- rank (
Int): Spatial rank of the convolution (1, 2, or 3).
Fields
- n (
Int): - input_dims (
Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)]): - output_dims (
Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)]): - filter_dims (
Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)]): - c (
Int): - f (
Int): - stride (
Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)]): - dilation (
Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)]): - pad_d (
Coord[Int64, Int64]): - pad_h (
Coord[Int64, Int64]): - pad_w (
Coord[Int64, Int64]): - num_groups (
Int):
Implemented traits
AnyType,
Copyable,
Deinitable,
ImplicitlyCopyable,
Movable,
RegisterPassable,
TrivialRegisterPassable
Methods
__init__
def __init__(n: Int, input_dims: Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)], output_dims: Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)], filter_dims: Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)], c: Int, f: Int, stride: Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)], dilation: Coord[*#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int64)], pad_d: Coord[Int64, Int64], pad_h: Coord[Int64, Int64], pad_w: Coord[Int64, Int64], num_groups: Int) -> Self
d
h
w
do
ho
wo
q
r
s
stride_at
def stride_at[axis: Int](self) -> Int
Stride along axis.
Parameters:
- axis (
Int): Spatial axis to read.
Returns:
dilation_at
def dilation_at[axis: Int](self) -> Int
Dilation along axis.
Parameters:
- axis (
Int): Spatial axis to read.
Returns:
pad_d_lower
pad_h_lower
pad_w_lower
filter_window_flat_size
input_image_flat_size
output_image_flat_size
output_space_dims
output_flat_coord_to_input_offset
matmul_M
matmul_N
matmul_K
padded
c_per_group
def c_per_group(self) -> Int
Returns the number of channels per group. Channel count must be divisible by group size.
Returns:
f_per_group
def f_per_group(self) -> Int
Returns the number of filters per group. Filter count must be divisible by group size.
Returns:
f_to_group
def f_to_group(self, f_idx: Int) -> Int
Given a global filter idx, returns the group idx of the group the filter belongs to.
Args:
- f_idx (
Int): Global filter index across all groups.
Returns:
c_to_group
def c_to_group(self, c_idx: Int) -> Int
Given a global channel idx, returns the group idx of the group the channel belongs to.
Args:
- c_idx (
Int): Global channel index across all groups.
Returns:
f_in_group
def f_in_group(self, f_idx: Int) -> Int
Given a global filter idx, returns the offset of the filter in its group.
Args:
- f_idx (
Int): Global filter index across all groups.
Returns: