private DimensionSizes sizesFromType(TensorType type) {
        DimensionSizes.Builder builder = new DimensionSizes.Builder(type.dimensions().size());
        for (int i = 0; i < type.dimensions().size(); i++)
            builder.set(i, type.dimensions().get(i).size().get());
        return builder.build();
    }
Returns dimension sizes from a type consisting of fully specified, indexed dimensions only
vespajlib/src/main/java/com/yahoo/tensor/serialization/DenseBinaryFormat.java