private Tensor toTensor(TensorType type, Object value, Embedder.Context context, Map<String, String> contextValues,
                            Properties properties) {
        if (value instanceof Tensor) return (Tensor)value;
        if (value instanceof String && isEmbed((String)value)) return embed((String)value, type, context, contextValues, properties);
        if (value instanceof String) return Tensor.from(type, (String)value);
        return null;
    }
A class which knows how to convert an Object value to a tensor of a given type.

@author bratseth
container-search/src/main/java/com/yahoo/search/schema/internal/TensorConverter.java