It sounds like you want to permute the dimensions - shifting the 0th dimension to be the 2nd dimension.
You could use permute(): target['a'].permute((1,2,0,3,4))
Note that permute() only returns a view of the tensor, but doesn’t change the underlying shape.  If you want to keep the new shape, you’ll need to save it:
target['a'] = target['a'].permute((1,2,0,3,4))

Also, your code looks like target['a'] is actually a list of tensors.  It would need to be a tensor for you to call PyTorch methods.  You can either convert it, or preallocate a tensor and then fill it in, or use something like torch.cat().