Permute function

VARP Permute(
  1. VARP input,
  2. List<int> dims
)

SSD network's permute layer.

Args:

  • input: A variable. Contains the feature map. Namely bottom0 in caffe.
  • dims: A vector. Contains the order.

Returns:

  • A variable.

Implementation

VARP Permute(VARP input, List<int> dims) {
  final (permPtr, permSize) = dims.toNativeArrayI32();
  final rval = VARP.fromPointer(C.mnn_expr_Permute(input.ptr, permPtr.cast(), permSize));
  calloc.free(permPtr);
  return rval;
}