private static void validateSizes(DimensionSizes sizes, int length) {
            if (sizes.totalSize() != length) {
                throw new IllegalArgumentException("Invalid size(" + length + ") of supplied value vector." +
                        " Type specifies that size should be " + sizes.totalSize());
            }
        }
Creates a builder initialized with the given values

@param type the type of the tensor to build
@param values the initial values of the tensor in the <i>standard value order</i>.
              This <b>transfers ownership</b> of the value array - it
              must not be further mutated by the caller
vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java