private void validateLabel(TensorType.Dimension dimension) throws IOException {
        JsonToken token = parser.nextToken();
        if (token != JsonToken.VALUE_STRING) {
            throw new InvalidConstantTensorException(parser, String.format("Tensor label is not a string (%s)", token.toString()));
        }
        if (dimension instanceof TensorType.IndexedBoundDimension) {
            validateBoundIndex((TensorType.IndexedBoundDimension) dimension);
        } else if (dimension instanceof TensorType.IndexedUnboundDimension) {
            validateUnboundIndex(dimension);
        }
    }
Tensor labels are always strings. Labels for a mapped dimension can be any string,
but those for indexed dimensions needs to be able to be interpreted as integers, and,
additionally, those for indexed bounded dimensions needs to fall within the dimension size.
config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java