Rotate a n-D tensor by 90 degrees in the plane specified by dims axis. Rotation direction is from the first towards the second axis if k > 0, and from the second towards the first for k < 0.
Rotate a n-D tensor by 90 degrees. The rotation direction and times are specified by axes. Rotation direction is from axes[0] towards axes[1] if k > 0, and from axes[1] towards axes[0] for k < 0.
Args:
Args:
x (Tensor): The input Tensor(or LoDTensor). The data type of the input Tensor x
x (Tensor): The input Tensor(or LoDTensor). The data type of the input Tensor x
should be float32, float64, int32, int64, bool.
should be float16, float32, float64, int32, int64, bool.
k (int): Number of times to rotate
k (int, optional): Direction and number of times to rotate, default value: 1.
axes (list|tuple): Axis to rotate
axes (list|tuple, optional): Axes to rotate, dimension must be 2. default value: [0, 1].
name (str, optional): The default value is None. Normally there is no need for user to set this property.
name (str, optional): The default value is None. Normally there is no need for user to set this property.
For more information, please refer to :ref:`api_guide_Name` .
For more information, please refer to :ref:`api_guide_Name` .
Returns:
Returns:
Tensor: Tensor or LoDTensor calculated by rot90 layer. The data type is same with input x.
Tensor: Tensor or LoDTensor calculated by rot90 layer. The data type is same with input x.
Raises:
TypeError: If the data type of ``x`` is not Variable
TypeError: If the dtype of ``x`` is not float16, float32, float64, int32, int64, bool
TypeError: If the data type of ``dims`` is not list, tuple