nativeAudioDepthwise function
void
nativeAudioDepthwise(
- Float32List x,
- Float32List w,
- Float32List bias,
- Float32List y, {
- required int channels,
- required int freq,
- required int time,
- required bool first,
Stride-2 audio convolution in channel, frequency, time order.
Implementation
void nativeAudioDepthwise(
Float32List x,
Float32List w,
Float32List bias,
Float32List y, {
required int channels,
required int freq,
required int time,
required bool first,
}) {
if (channels <= 0 ||
freq <= 0 ||
time <= 0 ||
x.length != (first ? 1 : channels) * freq * time ||
w.length != channels * 9 ||
bias.length != channels ||
y.length != channels * ((freq + 1) ~/ 2) * ((time + 1) ~/ 2)) {
throw ArgumentError('audio depthwise convolution: bad shapes');
}
_audioDepthwise(
x.address,
w.address,
bias.address,
y.address,
channels,
freq,
time,
first ? 1 : 0,
);
}