dpnp.tensor.stack

dpnp.tensor.stack(arrays, /, *, axis=0)[source]

Joins a sequence of arrays along a new axis.

Parameters:
  • arrays ({list of usm_ndarrays, tuple of usm_ndarrays}) -- Input arrays to join. Each array must have the same shape.

  • axis (int, optional) --

    Axis along which the arrays will be joined. Providing an axis specified the index of the new axis in the dimensions of the output array. A valid axis must be on the interval [-N, N), where N is the rank (number of dimensions) of x.

    Default: 0.

Returns:

out -- An output array having rank N+1, where N is the rank (number of dimensions) of x. If the input arrays have different data types, array API Type Promotion Rules apply.

Return type:

usm_ndarray

Raises:
  • ValueError -- If not all input arrays have the same shape.

  • IndexError -- If provided an axis outside of the required interval.