zeros<T extends SizedNativeType> function

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

zeros(shape, dtype=None, order='C') Return a new array of given shape and type, filled with zeros.

Parameters

shape : int or sequence of ints Shape of the new array, e.g., (2, 3) or 2. dtype : data-type, optional The desired data-type for the array, e.g., np.int8. Default is np.float32. order : {'C', 'F'}, optional, default: C Compatible with numpy.

Returns

out : Var Var of zeros with the given shape, dtype, and order.

Examples

np.zeros(5) var( 0., 0., 0., 0., 0.) np.ones((5,), dtype=int) var(0, 0, 0, 0, 0) np.ones((2, 1)) var([ 0., 0.]) s = (2,2) np.ones(s) var([ 0., 0., 0., 0.])

Implementation

VARP zeros<T extends ffi.SizedNativeType>(
  List<int> shape, {
  String order = "C",
}) {
  _orderAssert(order);
  return full<T>(shape, F.scalar<T>(0), order: order);
}