conv function
VARP
conv(
- VARP x,
- VARP weight, {
- VARP? bias,
- PaddingMode pad = PaddingMode.VALID,
- List<int> stride = const [1, 1],
- List<int> dilatie = const [1, 1],
- int group = 1,
- List<int> pads = const [0, 0],
})
Implementation
VARP conv(
VARP x,
VARP weight, {
VARP? bias,
PaddingMode pad = PaddingMode.VALID,
List<int> stride = const [1, 1],
List<int> dilatie = const [1, 1],
int group = 1,
List<int> pads = const [0, 0],
}) {
final (stridePtr, strideSize) = stride.toNativeArrayI32();
final (dilationPtr, dilationSize) = dilatie.toNativeArrayI32();
final (padPtr, padSize) = pads.toNativeArrayI32();
final rval = VARP.fromPointer(
C.mnn_expr_Conv(
weight.ptr,
bias?.ptr ?? ffi.nullptr,
x.ptr,
pad.value,
stridePtr.cast(),
strideSize,
dilationPtr.cast(),
dilationSize,
group,
padPtr.cast(),
padSize,
),
);
calloc.free(stridePtr);
calloc.free(dilationPtr);
calloc.free(padPtr);
return rval;
}