cupy.ones#

cupy.ones(shape, dtype=<class 'float'>, order='C')[source]#

Returns a new array of given shape and dtype, filled with ones.

This function currently does not support order option.

Parameters:
  • shape (int or tuple of ints) – Dimensionalities of the array.

  • dtype (data-type, optional) – Data type specifier.

  • order ({'C', 'F'}) – Row-major (C-style) or column-major (Fortran-style) order.

Returns:

An array filled with ones.

Return type:

cupy.ndarray

See also

numpy.ones()