Skip to content
Prev Previous commit
Next Next commit
Add reshape
  • Loading branch information
kgryte committed Sep 14, 2020
commit 71aa0b4f33e2d435a8acc5126411d1a67eb2bde4
24 changes: 22 additions & 2 deletions spec/API_specification/manipulation_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,32 @@ Reverses the order of elements in an array along the given axis. The shape of th

- input array.

- **axis**: _Optional\[ int, Tuple\[ int ] ]_
- **axis**: _Optional\[ Union\[ 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**: _<array>_

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

### <a name="reshape" href="#reshape">#</a> reshape(x, shape, /)

Reshapes an array without changing its data.

#### Parameters

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

- input array to reshape.

- **shape**: _Union\[ int, Tuple\[ int, ... ] ]_

- a new shape compatible with the original shape. If `shape` is an integer, then the result must be a one-dimensional array of that length. One shape dimension is allowed to be `-1`. When a shape dimension is `-1`, the corresponding output array shape dimension must be inferred from the length of the array and the remaining dimensions.

#### Returns

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

- an output array having the same data type, elements, and underlying element order as `x`.