mars.tensor.column_stack¶

mars.tensor.
column_stack
(tup)[source]¶ Stack 1D tensors as columns into a 2D tensor.
Take a sequence of 1D tensors and stack them as columns to make a single 2D tensor. 2D tensors are stacked asis, just like with hstack. 1D tensors are turned into 2D columns first.
 Parameters
tup (sequence of 1D or 2D tensors.) – Tensors to stack. All of them must have the same first dimension.
 Returns
stacked – The tensor formed by stacking the given tensors.
 Return type
2D tensor
See also
Examples
>>> import mars.tensor as mt
>>> a = mt.array((1,2,3)) >>> b = mt.array((2,3,4)) >>> mt.column_stack((a,b)).execute() array([[1, 2], [2, 3], [3, 4]])