chainer.functions.moveaxis¶
-
chainer.functions.
moveaxis
(x, source, destination)[source]¶ Move the source axes to the destination.
This function transpose the input
x
by moving the axessource
to the axesdestination
. Other axes remain in their original order.See also
chainer.functions.transpose()
,chainer.functions.swapaxes()
.Parameters: Returns: Variable whose axis is moved.
Return type: Example
>>> x = np.zeros((2, 3, 4, 5), np.float32) >>> chainer.functions.moveaxis(x, 0, -1).shape (3, 4, 5, 2) >>> chainer.functions.moveaxis(x, (0, 3), (2, 0)).shape (5, 3, 2, 4)