unstack¶
- paddle. unstack ( x, axis=0, num=None ) [source]
- 
         - Alias_main
- 
           paddle.unstack :alias: paddle.unstack,paddle.tensor.unstack,paddle.tensor.manipulation.unstack :old_api: paddle.fluid.layers.unstack 
 UnStack Layer This layer unstacks input Tensor xinto several Tensors alongaxis.If axis< 0, it would be replaced withaxis+rank(x). Ifnumis None, it would be inferred fromx.shape[axis], and ifx.shape[axis]<= 0 or is unknown,ValueErroris raised.- Parameters
- 
           - x (Tensor) – Input Tensor. It is a N-D Tensors of data types float32, float64, int32, int64. 
- axis (int) – The axis along which the input is unstacked. 
- num (int|None) – The number of output variables. 
 
- Returns
- 
           The unstacked Tensors list. The list elements are N-D Tensors of data types float32, float64, int32, int64. 
- Return type
- 
           list(Tensor) 
 Examples import paddle x = paddle.ones(name='x', shape=[2, 3, 5], dtype='float32') # create a tensor with shape=[2, 3, 5] y = paddle.unstack(x, axis=1) # unstack with second axis, which results 3 tensors with shape=[2, 5] 
