8000 Add specifications for array manipulation functions by kgryte · Pull Request #42 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content

Add specifications for array manipulation functions #42

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 14 commits into from
Sep 28, 2020
Prev Previous commit
Next Next commit
Add flip
  • Loading branch information
kgryte committed Sep 14, 2020
commit e6fa8ef397c745690e9ffbf1d4043d6ffdd25f96
24 changes: 22 additions & 2 deletions spec/API_specification/manipulation_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,30 @@ Joins a sequence of arrays along an existing axis.

- **axis**: _Optional\[ int ]_

- axis along which the arrays will be joined. If `axis` is `None`, arrays are flattened before concatenation. A negative `axis` is interpreted as counting from last dimension (i.e., `axis+rank(arrays)`-th dimension). Default: `0`.
- axis along which the arrays will be joined. If `axis` is `None`, arrays are flattened before concatenation. If `axis` is negative, the function must count from last dimension. Default: `0`.

#### Returns

- **out**: _<array>_

- an output array containing the concatenated values.
- an output array containing the concatenated values.

### <a name="flip" href="#flip">#</a> flip(x, /, *, axis=None)

Reverses the order of elements in an array along the given axis. The shape of the array must be preserved.

#### Parameters

- **x**: _&lt;array&gt;_

- input array.

- **axis**: _Optional\[ int, Tuple\[ int ] ]_

- axis (or axes) along which to flip. If `axis` is `None`, the function must flip all input array axes. If `axis` is negative, the function must count from the last dimension. If provided more than one axis, the function must flip only the specified axes. Default: `None`.

#### Returns

- **out**: _&lt;array&gt;_

- an output array having the same data type as `x` and whose axes, relative to `x`, are flipped.
0