private boolean simpleRenameIsPossible(int[] toIndexes) {
        for (int i = 0; i < toIndexes.length; ++i) {
            if (toIndexes[i] != i) {
                return false;
            }
        }
        return true;
    }
If none of the dimensions change order after rename we can do a simple rename.
vespajlib/src/main/java/com/yahoo/tensor/functions/Rename.java