Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify expected values in ones and ones_like when dtype is a complex number data type #438

Merged
merged 1 commit into from
Jun 6, 2022
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