scalar<T extends SizedNativeType> function
Implementation
VARP scalar<T extends ffi.SizedNativeType>(num value, {HalideType? dtype}) {
MnnAssert(
T != ffi.SizedNativeType || dtype != null,
"You must specify the generic type T or dtype. e.g., mnn.float32",
);
dtype ??= HalideType.of<T>();
final pdata = dtype.pointerOf([value]);
final pvar = C.mnn_expr_Scalar(pdata.cast(), dtype.native.ref);
calloc.free(pdata);
return VARP.fromPointer(pvar);
}