Class JitnnModel
java.lang.Object
ai.djl.BaseModel
ai.beestream.jitnn.djl.JitnnModel
- All Implemented Interfaces:
ai.djl.Model, AutoCloseable
public final class JitnnModel
extends ai.djl.BaseModel
A DJL model on jitNN.
load reads an ONNX file (<prefix>.onnx in the model
directory, the file itself, or the directory's only .onnx file) through jitnn-onnx; the
option "fp16" = "true" runs its products in half precision. A model whose block was set
in Java loads DJL's own parameter files instead.-
Field Summary
Fields inherited from class ai.djl.BaseModel
artifacts, block, dataType, inputData, manager, modelDir, modelName, properties, wasLoaded -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases the model's weights before closing it, so that loading the same model again reuses the plans compiled for this one.voidai.djl.training.TrainernewTrainer(ai.djl.training.TrainingConfig config) Methods inherited from class ai.djl.BaseModel
describeInput, describeOutput, finalize, getArtifact, getArtifact, getArtifactAsStream, getArtifactNames, getBlock, getDataType, getModelPath, getName, getNDManager, getProperties, getProperty, load, loadBlock, newPredictor, paramPathResolver, readParameters, readParameters, save, setBlock, setDataType, setModelDir, setProperty, toStringMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.djl.Model
cast, getProperty, intProperty, load, load, load, longProperty, newPredictor, quantize
-
Method Details
-
load
public void load(Path modelPath, String prefix, Map<String, ?> options) throws IOException, ai.djl.MalformedModelException- Throws:
IOExceptionai.djl.MalformedModelException
-
close
public void close()Releases the model's weights before closing it, so that loading the same model again reuses the plans compiled for this one.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceai.djl.Model- Overrides:
closein classai.djl.BaseModel
-
newTrainer
public ai.djl.training.Trainer newTrainer(ai.djl.training.TrainingConfig config) - Specified by:
newTrainerin interfaceai.djl.Model- Overrides:
newTrainerin classai.djl.BaseModel
-