public interface TranslatorFactory
Translator instances.| Modifier and Type | Method and Description |
|---|---|
java.util.Set<ai.djl.util.Pair<java.lang.reflect.Type,java.lang.reflect.Type>> |
getSupportedTypes()
Returns supported input/output classes.
|
default boolean |
isSupported(java.lang.Class<?> input,
java.lang.Class<?> output)
Returns if the input/output is supported by the
TranslatorFactory. |
Translator<?,?> |
newInstance(java.lang.Class<?> input,
java.lang.Class<?> output,
Model model,
java.util.Map<java.lang.String,?> arguments)
Returns a new instance of the
Translator class. |
java.util.Set<ai.djl.util.Pair<java.lang.reflect.Type,java.lang.reflect.Type>> getSupportedTypes()
default boolean isSupported(java.lang.Class<?> input,
java.lang.Class<?> output)
TranslatorFactory.input - the input classoutput - the output classtrue if the input/output type is supportedTranslator<?,?> newInstance(java.lang.Class<?> input, java.lang.Class<?> output, Model model, java.util.Map<java.lang.String,?> arguments) throws TranslateException
Translator class.input - the input classoutput - the output classmodel - the Model that uses the Translatorarguments - the configurations for a new Translator instanceTranslator classTranslateException - if failed to create Translator instance