8000 Add specification for explicitly casting an array to a specified dtype by kgryte · Pull Request #290 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content

Add specification for explicitly casting an array to a specified dtype #290

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

Merged
merged 6 commits into from
Nov 1, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add support for a copy keyword
  • Loading branch information
kgryte committed Nov 1, 2021
commit 69d52ef8e23f607108b7d175f6a49f9f610cf853
6 changes: 5 additions & 1 deletion spec/API_specification/data_type_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A conforming implementation of the array API standard must provide and support t
## Objects in API

(function-astype)=
### astype(x, dtype, /)
### astype(x, dtype, /, *, copy=True)

Copies an array to a specified data type irrespective of {ref}`type-promotion` rules.

Expand All @@ -27,6 +27,10 @@ Casting floating-point `NaN` and `infinity` values to integral data types is not

- desired data type.

- **copy**: _<bool>_

- specifies whether to copy an array when the specified `dtype` matches the data type of the input array `x`. If `True`, a newly allocated array must always be returned. If `False` and the specified `dtype` matches the data type of the input array, the input array must be returned; otherwise, a newly allocated must be returned. Default: `True`.

#### Returns

- **out**: _<array>_
Expand Down
0