PReLU function

VARP PReLU(
  1. VARP x,
  2. List<double> slopes
)

Given an input value x, it computes the output as x if x > 0 and slopes * x if x <= 0.

Args:

  • x: A variable, must be 4-D with NC4HW4 format.
  • slopes: A vector, has save size as x.

Returns:

  • output: A variable with the same type as x.

Implementation

VARP PReLU(VARP x, List<double> slopes) {
  final (slopesPtr, slopesSize) = slopes.toNativeArrayF32();
  final rval = VARP.fromPointer(C.mnn_expr_PRelu(x.ptr, slopesPtr.cast(), slopesSize));
  calloc.free(slopesPtr);
  return rval;
}