nativeAudioDepthwise function

void nativeAudioDepthwise(
  1. Float32List x,
  2. Float32List w,
  3. Float32List bias,
  4. Float32List y, {
  5. required int channels,
  6. required int freq,
  7. required int time,
  8. 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,
  );
}