public static Long dimensionSize(TensorType.Dimension dim) {
        return dim.size().orElseThrow(() -> new IllegalArgumentException("Dimension has no size"));
    }
When dimension ordering between Vespa and imported differs, i.e.
after dimension renaming, use the dimension map to read in values
so that they are correctly laid out in memory for Vespa.
Used when importing tensors.
model-integration/src/main/java/ai/vespa/rankingexpression/importer/OrderedTensorType.java