private static Tensor tensorFromMixedValueString(String valueString,
                                                     Optional<TensorType> type,
                                                     List<String> dimensionOrder) {
        if (type.isEmpty())
            throw new IllegalArgumentException("The mixed tensor form requires an explicit tensor type " +
                                               "on the form 'tensor(dimensions):...");
        long numMappedDims = type.get().dimensions().stream().filter(d -> d.isMapped()).count();
        try {
            valueString = valueString.trim();
            if ( ! valueString.startsWith("{") && valueString.endsWith("}"))
                throw new IllegalArgumentException("A mixed tensor must be enclosed in {}");
            Tensor.Builder builder = Tensor.Builder.of(type.get());
            if (numMappedDims == 0) {
                if (! SingleUnboundParser.canHandle(type.get())) {
                    throw new IllegalArgumentException("No suitable dimension in " + type.get() + " for parsing a tensor on " +
                                                       "the mixed form: Should have one mapped dimension");
                }
                var parser = new SingleUnboundParser(valueString, builder);
                parser.parse();
            } else {
                var parser = new GenericMixedValueParser(valueString, dimensionOrder, builder);
                parser.parse();
            }
            return builder.build();
        }
        catch (NumberFormatException e) {
            throw new IllegalArgumentException("Excepted a number or a string starting by '{' or 'tensor('");
        }
    }
Derives the tensor type from the first address string in the given tensor string
vespajlib/src/main/java/com/yahoo/tensor/TensorParser.java