empty<T extends SizedNativeType> function

VARP empty<T extends SizedNativeType>(
  1. List<int> shape, {
  2. String order = "C",
})

empty(shape, dtype=float32) Return a new var of given shape and type, without initializing entries.

Parameters

shape : int or tuple of int Shape of the empty var, e.g., (2, 3) or 2. dtype : data-type, optional Desired output data-type for the array, e.g, np.int8. Default is np.float32. order : {'C', 'F', 'A', or 'K'}, optional Compatible with numpy.

Returns

out : var Var of uninitialized (arbitrary) data of the given shape, dtype, and order. Object arrays will be initialized to None.

Example:

np.empty(2, 2)

Implementation

VARP empty<T extends ffi.SizedNativeType>(List<int> shape, {String order = "C"}) {
  MnnAssert(T != ffi.SizedNativeType, "You must specify the generic type T. e.g., mnn.float32");
  _orderAssert(order);
  return F.input<T>(shape, dataFormat: DimensionFormat.NCHW);
}