Package ai.djl.translate
Class NoopTranslator
- java.lang.Object
-
- ai.djl.translate.NoopTranslator
-
- All Implemented Interfaces:
PostProcessor<NDList>
,PreProcessor<NDList>
,Translator<NDList,NDList>
public class NoopTranslator extends java.lang.Object implements Translator<NDList,NDList>
A no operationalTranslator
implementation.
-
-
Constructor Summary
Constructors Constructor Description NoopTranslator()
Constructs aNoopTranslator
.NoopTranslator(Batchifier batchifier)
Constructs aNoopTranslator
with the givenBatchifier
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Batchifier
getBatchifier()
Gets theBatchifier
.NDList
processInput(TranslatorContext ctx, NDList input)
Processes the input and converts it to NDList.NDList
processOutput(TranslatorContext ctx, NDList list)
Processes the output NDList to the corresponding output object.void
setBatchifier(Batchifier batchifier)
Sets theBatchifier
for the Translator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.djl.translate.Translator
prepare
-
-
-
-
Constructor Detail
-
NoopTranslator
public NoopTranslator(Batchifier batchifier)
Constructs aNoopTranslator
with the givenBatchifier
.- Parameters:
batchifier
- batchifier to use
-
NoopTranslator
public NoopTranslator()
Constructs aNoopTranslator
.
-
-
Method Detail
-
processInput
public NDList processInput(TranslatorContext ctx, NDList input)
Processes the input and converts it to NDList.- Specified by:
processInput
in interfacePreProcessor<NDList>
- Parameters:
ctx
- the toolkit for creating the input NDArrayinput
- the input object- Returns:
- the
NDList
after pre-processing
-
processOutput
public NDList processOutput(TranslatorContext ctx, NDList list)
Processes the output NDList to the corresponding output object.- Specified by:
processOutput
in interfacePostProcessor<NDList>
- Parameters:
ctx
- the toolkit used for post-processinglist
- the output NDList after inference- Returns:
- the output object of expected type
-
getBatchifier
public Batchifier getBatchifier()
Gets theBatchifier
.- Specified by:
getBatchifier
in interfaceTranslator<NDList,NDList>
- Returns:
- the
Batchifier
-
setBatchifier
public void setBatchifier(Batchifier batchifier)
Sets theBatchifier
for the Translator.- Parameters:
batchifier
- theBatchifier
for the Translator
-
-