Package ai.djl.translate
Interface TranslatorOptions
-
public interface TranslatorOptionsA set of possible options forTranslators with different input and output types.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Set<ai.djl.util.Pair<java.lang.reflect.Type,java.lang.reflect.Type>>getOptions()Returns the supported wrap types.default booleanisSupported(java.lang.Class<?> input, java.lang.Class<?> output)Returns if the input/output is a supported wrap type.<I,O>
Translator<I,O>option(java.lang.Class<I> input, java.lang.Class<O> output)Returns theTranslatoroption with the matching input and output type.
-
-
-
Method Detail
-
getOptions
java.util.Set<ai.djl.util.Pair<java.lang.reflect.Type,java.lang.reflect.Type>> getOptions()
Returns the supported wrap types.- Returns:
- the supported wrap types
- See Also:
option(Class, Class)
-
isSupported
default boolean isSupported(java.lang.Class<?> input, java.lang.Class<?> output)Returns if the input/output is a supported wrap type.- Parameters:
input- the input classoutput- the output class- Returns:
trueif the input/output type is supported- See Also:
option(Class, Class)
-
option
<I,O> Translator<I,O> option(java.lang.Class<I> input, java.lang.Class<O> output) throws TranslateException
Returns theTranslatoroption with the matching input and output type.- Type Parameters:
I- the input data typeO- the output data type- Parameters:
input- the input classoutput- the output class- Returns:
- a new instance of the
Translatorclass - Throws:
TranslateException- if failed to create Translator instance
-
-