private static Map<String, String> fromToMap(List<String> fromDimensions, List<String> toDimensions) {
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < fromDimensions.size(); i++)
            map.put(fromDimensions.get(i), toDimensions.get(i));
        return map;
    }
The <i>rename</i> tensor function returns a tensor where some dimensions are assigned new names.

@author bratseth
vespajlib/src/main/java/com/yahoo/tensor/functions/Rename.java