Array API compatible wrapper for :py:func:`np.stack `. See its docstring for more information.
(arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: int = 0)
| 101 | |
| 102 | |
| 103 | def stack(arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: int = 0) -> Array: |
| 104 | """ |
| 105 | Array API compatible wrapper for :py:func:`np.stack <numpy.stack>`. |
| 106 | |
| 107 | See its docstring for more information. |
| 108 | """ |
| 109 | # Call result type here just to raise on disallowed type combinations |
| 110 | result_type(*arrays) |
| 111 | arrays = tuple(a._array for a in arrays) |
| 112 | return Array._new(np.stack(arrays, axis=axis)) |