Add an option to reverse dim order: reverse_dim