Class PpPredictor<I,​O>

  • All Implemented Interfaces:
    java.lang.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 DlrPredictor, we clone Paddle predictor handle to workaround the issue.

    • Field Summary

      • Fields inherited from class ai.djl.inference.Predictor

        block, manager, metrics, parameterStore
    • 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      • Methods inherited from class ai.djl.inference.Predictor

        batchPredict, finalize, predict, predictInternal, setMetrics
      • Methods inherited from class java.lang.Object

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

      • 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 Detail

      • close

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