chainerx.ones

chainerx.ones(shape, dtype, device=None)

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

Parameters
  • shape (tuple of ints) – Shape of the array.

  • dtype – Data type.

  • device (Device) – Device on which the array is allocated. If omitted, the default device is chosen.

Returns

New array.

Return type

ndarray

See also

numpy.ones()