public abstract class Engine
extends java.lang.Object
Engine interface is the base of the provided implementation for DJL.
Any framework-specific functionality should be provided through this class. In general, it
should contain methods to detect information about the usable machine hardware and to create a
new NDManager and Model.
EngineProvider| Constructor and Description |
|---|
Engine() |
| Modifier and Type | Method and Description |
|---|---|
void |
debugEnvironment()
Logs debug information about the environment for use when debugging environment issues.
|
static Engine |
getEngine(java.lang.String engineName)
Returns the
Engine with the given name. |
abstract java.lang.String |
getEngineName()
Returns the name of the Engine.
|
static Engine |
getInstance()
Returns the default Engine.
|
abstract java.lang.String |
getVersion()
Returns the version of the deep learning framework.
|
abstract boolean |
hasCapability(java.lang.String capability)
Returns whether the engine has the specified capability.
|
abstract NDManager |
newBaseManager()
Creates a new top-level
NDManager. |
abstract NDManager |
newBaseManager(Device device)
|
abstract Model |
newModel(Device device)
Constructs a new model.
|
abstract void |
setRandomSeed(int seed)
Seeds the random number generator in DJL Engine.
|
public abstract java.lang.String getEngineName()
public static Engine getInstance()
EngineEngineProviderpublic static Engine getEngine(java.lang.String engineName)
Engine with the given name.engineName - the name of Engine to retrieveEngineEngineProviderpublic abstract java.lang.String getVersion()
public abstract boolean hasCapability(java.lang.String capability)
capability - the capability to retrievetrue if the engine has the specified capabilitypublic abstract Model newModel(Device device)
device - the device that the model will be loaded ontopublic abstract NDManager newBaseManager()
NDManagerpublic abstract NDManager newBaseManager(Device device)
device - the default DeviceNDManagerpublic abstract void setRandomSeed(int seed)
This will affect all Devices and all operators using Engine's random number
generator.
seed - the seed to be fixed in Enginepublic void debugEnvironment()