Package org.deeplearning4j.parallelism
Class InplaceParallelInference.ModelHolder
- java.lang.Object
-
- org.deeplearning4j.parallelism.InplaceParallelInference.ModelHolder
-
- Enclosing class:
- InplaceParallelInference
protected static class InplaceParallelInference.ModelHolder extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isCG
protected boolean
isMLN
protected LoadBalanceMode
loadBalanceMode
protected ReentrantReadWriteLock
modelLock
protected AtomicLong
position
protected BlockingQueue<org.deeplearning4j.nn.api.Model>
queue
protected List<org.deeplearning4j.nn.api.Model>
replicas
protected boolean
rootDevice
protected org.deeplearning4j.nn.api.Model
sourceModel
protected int
targetDeviceId
protected int
workers
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModelHolder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.deeplearning4j.nn.api.Model
acquireModel()
protected void
init()
protected org.nd4j.linalg.api.ndarray.INDArray[]
output(org.nd4j.linalg.api.ndarray.INDArray[] input, org.nd4j.linalg.api.ndarray.INDArray[] inputMasks)
protected void
releaseModel(org.deeplearning4j.nn.api.Model model)
protected void
updateModel(@NonNull org.deeplearning4j.nn.api.Model model)
-
-
-
Field Detail
-
sourceModel
protected org.deeplearning4j.nn.api.Model sourceModel
-
workers
protected int workers
-
replicas
protected List<org.deeplearning4j.nn.api.Model> replicas
-
rootDevice
protected boolean rootDevice
-
loadBalanceMode
protected LoadBalanceMode loadBalanceMode
-
targetDeviceId
protected int targetDeviceId
-
position
protected final AtomicLong position
-
modelLock
protected final ReentrantReadWriteLock modelLock
-
queue
protected final BlockingQueue<org.deeplearning4j.nn.api.Model> queue
-
isCG
protected transient boolean isCG
-
isMLN
protected transient boolean isMLN
-
-
Method Detail
-
init
protected void init()
-
acquireModel
protected org.deeplearning4j.nn.api.Model acquireModel() throws InterruptedException
- Throws:
InterruptedException
-
releaseModel
protected void releaseModel(org.deeplearning4j.nn.api.Model model)
-
output
protected org.nd4j.linalg.api.ndarray.INDArray[] output(org.nd4j.linalg.api.ndarray.INDArray[] input, org.nd4j.linalg.api.ndarray.INDArray[] inputMasks)
-
updateModel
protected void updateModel(@NonNull @NonNull org.deeplearning4j.nn.api.Model model)
-
-