Skip to main content
Log in

Mojo struct

Naive2dConvolution

struct Naive2dConvolution[output_type: DType, input_type: DType, filter_type: DType]

Struct wrapper for naive 2d convolution implementation.

Fields

  • output (UnsafePointer[SIMD[output_type, 1]]):
  • input (UnsafePointer[SIMD[input_type, 1]]):
  • filter (UnsafePointer[SIMD[filter_type, 1]]):
  • pad_d (Index[2]):
  • pad_h (Index[2]):
  • pad_w (Index[2]):
  • stride (Index[3]):
  • dilation (Index[3]):
  • num_groups (Int):
  • output_shape (Index[5]):
  • input_shape (Index[5]):
  • filter_shape (Index[5]):

Implemented traits

AnyType, Copyable, ExplicitlyCopyable, Movable, UnknownDestructibility

Methods

__init__

__init__(out self, output: UnsafePointer[SIMD[output_type, 1]], input: UnsafePointer[SIMD[input_type, 1]], filter: UnsafePointer[SIMD[filter_type, 1]], output_shape: Index[5], input_shape: Index[5], filter_shape: Index[5], pad_d: Index[2], pad_h: Index[2], pad_w: Index[2], stride: Index[3], dilation: Index[3], num_groups: Int)

run

static run(output: UnsafePointer[SIMD[output_type, 1]], input: UnsafePointer[SIMD[input_type, 1]], filter: UnsafePointer[SIMD[filter_type, 1]], output_shape: Index[5], input_shape: Index[5], filter_shape: Index[5], pad_d: Index[2], pad_h: Index[2], pad_w: Index[2], stride: Index[3], dilation: Index[3], num_groups: Int)