Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions spec/API_specification/array_api/creation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ def ones(shape: Union[int, Tuple[int, ...]], *, dtype: Optional[dtype] = None, d
"""
Returns a new array having a specified ``shape`` and filled with ones.

.. note::
An output array having a complex floating-point data type must contain complex numbers having a real component equal to one and an imaginary component equal to zero (i.e., ``1 + 0j``).

Parameters
----------
shape: Union[int, Tuple[int, ...]]
Expand All @@ -289,6 +292,9 @@ def ones_like(x: array, /, *, dtype: Optional[dtype] = None, device: Optional[de
"""
Returns a new array filled with ones and having the same ``shape`` as an input array ``x``.

.. note::
An output array having a complex floating-point data type must contain complex numbers having a real component equal to one and an imaginary component equal to zero (i.e., ``1 + 0j``).

Parameters
----------
x: array
Expand Down