TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.functional.dstack

tensorplay.functional.dstack(tensors, *, out=None) → Tensor[source]

Stack tensors in sequence depthwise (along third axis).

This is equivalent to concatenation along the third axis after 1-D and 2-D tensors have been reshaped by tensorplay.atleast_3d().

Parameters:

tensors (sequence of Tensors) – sequence of tensors to concatenate

Keyword Arguments:

out (Tensor, optional) – the output tensor.

Example:

>>> a = tensorplay.tensor([1, 2, 3])
>>> b = tensorplay.tensor([4, 5, 6])
>>> tensorplay.dstack((a,b))
tensor([[[1, 4],
         [2, 5],
         [3, 6]]])
>>> a = tensorplay.tensor([[1],[2],[3]])
>>> b = tensorplay.tensor([[4],[5],[6]])
>>> tensorplay.dstack((a,b))
tensor([[[1, 4]],
        [[2, 5]],
        [[3, 6]]])

On this page

Ask DeepWiki