zerosLike<T extends SizedNativeType> function

VARP zerosLike<T extends SizedNativeType>(
  1. VARP a, {
  2. String order = "K",
  3. List<int>? shape,
})

zeros_like(a, dtype=None, order='K', subok=True, shape=None) Return an array of zeros with the same shape and type as a given array.

Parameters

a : var_like The shape and data-type of a define these same attributes of the returned array. dtype : data-type, optional Overrides the data type of the result. order : {'C', 'F', 'A', or 'K'}, optional Compatible with numpy. subok : bool, optional. Compatible with numpy. shape : int or sequence of ints, optional. Overrides the shape of the result.

Returns

out : Var Var of zeros with the same shape and type as a.

Examples

x = np.arange(6) x = x.reshape((2, 3)) x var([0, 1, 2, 3, 4, 5]) np.zeros_like(x) var([0, 0, 0, 0, 0, 0]) y = np.arange(3, dtype=float) y var(0., 1., 2.) np.zeros_like(y) var(0., 0., 0.)

Implementation

VARP zerosLike<T extends ffi.SizedNativeType>(
  VARP a, {
  String order = "K",
  List<int>? shape,
}) {
  return fullLike<T>(a, 0, order: order, shape: shape);
}