Class PpPredictor<I,O>

java.lang.Object
ai.djl.inference.Predictor<I,O>
ai.djl.paddlepaddle.engine.PpPredictor<I,O>
All Implemented Interfaces:
AutoCloseable

public class PpPredictor<I,O> extends ai.djl.inference.Predictor<I,O>
PpPredictor is special implementation of Predictor for PaddlePaddle.

When creating a new PpPredictor, we clone Paddle predictor handle to workaround the issue.

  • Nested Class Summary

    Nested classes/interfaces inherited from class ai.djl.inference.Predictor

    ai.djl.inference.Predictor.PredictorContext
  • Field Summary

    Fields inherited from class ai.djl.inference.Predictor

    block, manager, metrics, model, parameterStore, prepared, timestamp, translator
  • Constructor Summary

    Constructors
    Constructor
    Description
    PpPredictor(ai.djl.Model model, PaddlePredictor predictor, ai.djl.translate.Translator<I,O> translator, ai.djl.Device device)
    Creates a new instance of PaddlePredictor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void

    Methods inherited from class ai.djl.inference.Predictor

    batchPredict, finalize, predict, predictInternal, setMetrics, streamingPredict, supportsStreaming

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PpPredictor

      public PpPredictor(ai.djl.Model model, PaddlePredictor predictor, ai.djl.translate.Translator<I,O> translator, ai.djl.Device device)
      Creates a new instance of PaddlePredictor.
      Parameters:
      model - the model on which the predictions are based
      predictor - the C++ Paddle Predictor handle
      translator - the translator to be used
      device - the device to be used
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class ai.djl.inference.Predictor<I,O>