cupy.ones

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

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

This function currently does not support order option.

Parameters:
  • shape (tuple of ints) – Dimensionalities of the array.
  • dtype – Data type specifier.
Returns:

An array filled with ones.

Return type:

cupy.ndarray

See also

numpy.ones()