call method

MlxArray call(
  1. MlxArray input
)

Implementation

MlxArray call(MlxArray input) {
  final pw1 = _pointwiseConv1(input);
  final glu = parakeetGlu(pw1);
  pw1.close();
  final leftPad = mx.zeros(<int>[
    glu.shape[0],
    padding,
    glu.shape[2],
  ], dtype: glu.dtype);
  final rightPad = mx.zeros(<int>[
    glu.shape[0],
    padding,
    glu.shape[2],
  ], dtype: glu.dtype);
  final padded = mx.concatenate(<MlxArray>[leftPad, glu, rightPad], axis: 1);
  leftPad.close();
  rightPad.close();
  glu.close();
  final depth = _depthwiseConv(padded);
  padded.close();
  final normed = batchNorm(depth);
  depth.close();
  final activated = parakeetSilu(normed);
  normed.close();
  final out = _pointwiseConv2(activated);
  activated.close();
  return out;
}