column_stack(tensors) → Tensor¶
Creates a new tensor by horizontally stacking the tensors in
oneflow.hstack(tensors), tensors with dimensions less than 2 will be reshaped to
(t.numel(), 1)before being stacked horizontally.
The documentation is referenced from: https://pytorch.org/docs/1.10/generated/torch.column_stack.html.
tensors – (List[oneflow.Tensor]): sequence of tensors to stack
>>> import oneflow as flow >>> x1 = flow.randn(5) >>> x2 = flow.randn(5) >>> flow.column_stack([x1, x2]).shape oneflow.Size([5, 2]) >>> x1 = flow.randn(2, 5) >>> x2 = flow.randn(2, 2) >>> flow.column_stack([x1, x2]).shape oneflow.Size([2, 7])