Stacks tensors in sequence depth wise (along the third axis). This is equivalent to concatenation along the third axis. 1-D tensors \((N,)\) should be reshaped to \((1,N,1)\). 2-D tensors \((M,N)\) should be reshaped to \((M,N,1)\) before concatenation.
Stacked Tensor, formed by stacking the given tensors.
- Supported Platforms:
>>> import mindspore.numpy as np >>> x1 = np.array([1, 2, 3]).astype('float32') >>> x2 = np.array([4, 5, 6]).astype('float32') >>> output = np.dstack((x1, x2)) >>> print(output) [[[1. 4.] [2. 5.] [3. 6.]]]