MCPcopy Create free account
hub / github.com/numpy/numpy / stack

Function stack

numpy/array_api/_manipulation_functions.py:103–112  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.stack `. See its docstring for more information.

(arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: int = 0)

Source from the content-addressed store, hash-verified

101
102
103def 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))

Callers 1

test_stack_errorsFunction · 0.50

Calls 2

_newMethod · 0.80
result_typeFunction · 0.70

Tested by 1

test_stack_errorsFunction · 0.40