public Optional<Tensor> getTensor(String name) {
        Object feature = features.get(name);
        if (feature == null) return Optional.empty();
        if (feature instanceof Tensor) return Optional.of((Tensor)feature);
        if (feature instanceof Double) return Optional.of(Tensor.from((Double)feature));
        throw new IllegalArgumentException("Expected '" + name + "' to be a tensor, but it is the string '" + feature +
                "', this usually means that '" + name + "' is not defined in the schema. " +
                "See https://docs.vespa.ai/en/tensor-user-guide.html#querying-with-tensors");
    }
Returns a rank feature as a tensor, or empty if there is no value with this name.

@throws IllegalArgumentException if the value is a string, not a tensor or double
container-search/src/main/java/com/yahoo/search/query/ranking/RankFeatures.java