Permute Dimensions Cyclically
Description
Perform a cyclic permutation of the dimensions of a tensor. For a tensor of shape (D1, D2, D3, D4), a cyclic permutation would result in (D4, D1, D2, D3).
Starter Code
import torch
from einops import rearrange
def cyclic_permute(tensor):
# Your einops code here
pass
Verification
For an input of shape (10, 20, 30, 40), the output should have the shape (40, 10, 20, 30).