public abstract class Engine
extends java.lang.Object
Constructor and Description |
---|
Engine() |
Modifier and Type | Method and Description |
---|---|
static void |
debugEnvironment()
Prints debug information about the environment for debugging environment issues.
|
Device |
defaultDevice()
Returns the engine's default
Device . |
static java.util.Set<java.lang.String> |
getAllEngines()
Returns a set of engine names that are loaded.
|
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 int |
getRank()
Return the rank of the
Engine . |
java.lang.Integer |
getSeed()
Returns the random seed in DJL Engine.
|
abstract java.lang.String |
getVersion()
Returns the version of the deep learning engine.
|
abstract boolean |
hasCapability(java.lang.String capability)
Returns whether the engine has the specified capability.
|
static boolean |
hasEngine(java.lang.String engineName)
Returns if the specified engine is available.
|
abstract NDManager |
newBaseManager()
Creates a new top-level
NDManager . |
abstract NDManager |
newBaseManager(Device device)
|
abstract GradientCollector |
newGradientCollector()
Returns a new instance of
GradientCollector . |
abstract Model |
newModel(java.lang.String name,
Device device)
Constructs a new model.
|
ParameterServer |
newParameterServer(Optimizer optimizer)
Returns a new instance of
ParameterServer . |
abstract SymbolBlock |
newSymbolBlock(NDManager manager)
Construct an empty SymbolBlock for loading.
|
void |
setRandomSeed(int seed)
Seeds the random number generator in DJL Engine.
|
public abstract java.lang.String getEngineName()
public abstract int getRank()
Engine
.public static Engine getInstance()
Engine
EngineProvider
public static boolean hasEngine(java.lang.String engineName)
engineName
- the name of Engine to checktrue
if the specified engine is availableEngineProvider
public static java.util.Set<java.lang.String> getAllEngines()
public static Engine getEngine(java.lang.String engineName)
Engine
with the given name.engineName
- the name of Engine to retrieveEngine
EngineProvider
public 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 Device defaultDevice()
Device
.Device
public abstract SymbolBlock newSymbolBlock(NDManager manager)
manager
- the manager to manage parametersSymbolBlock
for static graphpublic abstract Model newModel(java.lang.String name, Device device)
name
- the model namedevice
- the device that the model will be loaded ontopublic abstract NDManager newBaseManager()
NDManager
public abstract NDManager newBaseManager(Device device)
device
- the default Device
NDManager
public abstract GradientCollector newGradientCollector()
GradientCollector
.GradientCollector
public ParameterServer newParameterServer(Optimizer optimizer)
ParameterServer
.optimizer
- the optimizer to updateParameterServer
public void setRandomSeed(int seed)
This will affect all Device
s and all operators using Engine's random number
generator.
seed
- the seed to be fixed in Enginepublic java.lang.Integer getSeed()
public static void debugEnvironment()