chainerx.ones_like

chainerx.ones_like(a, device=None)

Returns an array of ones with same shape and dtype as a given array.

Parameters
Returns

New array.

Return type

ndarray

Warning

If device argument is omitted, the new array is created on the default device, not the device of the prototype array.