Many of DJL engines only has limited support for NDArray operations. Here is a list of such engines:
Currently, those engines only covers the basic NDArray creation methods. To better support the necessary preprocessing and postprocessing, you can use one of the full Engines along with it to run in a hybrid mode:
To use it along with Apache MXNet for additional API support, add the following two dependencies:
You can also use PyTorch or TensorFlow Engine as the supplemental engine by adding their corresponding dependencies.
Internally, DJL will find two or more engines available. When you start using the hybrid engine, DJL will search for additional full Engines. Whenever an unsupported NDArray operation is invoked, it will delegate to alternative full engine to run the operation. If you don’t need preprocessing/postprocessing and trying to avoid loading another engine at runtime, you can disable this behavior by setting the following system properties:
# disable hybrid engine for OnnxRuntime System.setProperty("ai.djl.onnx.disable_alternative", "true"); # disable hybrid engine for PaddlePaddle System.setProperty("ai.djl.paddlepaddle.disable_alternative", "true"); # disable hybrid engine for TensorFlow Lite System.setProperty("ai.djl.tflite.disable_alternative", "true"); # disable hybrid engine for TensorRT System.setProperty("ai.djl.tensorrt.disable_alternative", "true"); # disable hybrid engine for Neo DLR System.setProperty("ai.djl.dlr.disable_alternative", "false");