public class LayerWorkspaceMgr extends BaseWorkspaceMgr<ArrayType>
WorkspaceMgr
for DL4J layers.
Used to flexibly specify which workspaces a given array type (defined by ArrayType
) should be placed inModifier and Type | Class and Description |
---|---|
static class |
LayerWorkspaceMgr.Builder |
Modifier and Type | Field and Description |
---|---|
static String |
CUDNN_WORKSPACE_KEY |
protected Map<String,org.bytedeco.javacpp.Pointer> |
helperWorkspacePointers |
protected Set<String> |
noLeverageOverride |
configMap, scopeOutOfWs, workspaceNames
Constructor and Description |
---|
LayerWorkspaceMgr(Set<ArrayType> scopeOutOfWs,
Map<ArrayType,org.nd4j.linalg.api.memory.conf.WorkspaceConfiguration> configMap,
Map<ArrayType,String> workspaceNames) |
Modifier and Type | Method and Description |
---|---|
static LayerWorkspaceMgr.Builder |
builder() |
<T extends org.bytedeco.javacpp.Pointer> |
getHelperWorkspace(String key)
Get the pointer to the helper memory.
|
INDArray |
leverageTo(ArrayType arrayType,
INDArray array) |
static LayerWorkspaceMgr |
noWorkspaces() |
static LayerWorkspaceMgr |
noWorkspaces(Map<String,org.bytedeco.javacpp.Pointer> helperWorkspacePointers) |
static LayerWorkspaceMgr |
noWorkspacesImmutable() |
void |
setHelperWorkspace(String key,
org.bytedeco.javacpp.Pointer value)
Set the pointer to the helper memory.
|
void |
setNoLeverageOverride(String wsName) |
INDArray |
validateArrayLocation(ArrayType arrayType,
INDArray array,
boolean migrateIfInvalid,
boolean exceptionIfDetached) |
assertCurrentWorkspace, assertNotOpen, assertOpen, create, create, create, create, createUninitialized, createUninitialized, createUninitialized, createUninitialized, dup, dup, getConfiguration, getWorkspaceName, hasConfiguration, isScopedOut, isWorkspaceOpen, notifyScopeBorrowed, notifyScopeEntered, notifyScopeEntered, setConfiguration, setScopedOutFor, setWorkspace, setWorkspaceName
public static String CUDNN_WORKSPACE_KEY
public void setNoLeverageOverride(String wsName)
public INDArray leverageTo(ArrayType arrayType, INDArray array)
leverageTo
in interface WorkspaceMgr<ArrayType>
leverageTo
in class BaseWorkspaceMgr<ArrayType>
public INDArray validateArrayLocation(@NonNull ArrayType arrayType, @NonNull INDArray array, boolean migrateIfInvalid, boolean exceptionIfDetached)
validateArrayLocation
in interface WorkspaceMgr<ArrayType>
validateArrayLocation
in class BaseWorkspaceMgr<ArrayType>
public <T extends org.bytedeco.javacpp.Pointer> T getHelperWorkspace(String key)
T
- Pointer typekey
- Key for the helper workspace pointerpublic void setHelperWorkspace(@NonNull String key, org.bytedeco.javacpp.Pointer value)
key
- Key for the helper workspace pointervalue
- Pointerpublic static LayerWorkspaceMgr.Builder builder()
public static LayerWorkspaceMgr noWorkspaces(Map<String,org.bytedeco.javacpp.Pointer> helperWorkspacePointers)
helperWorkspacePointers
- Helper pointers - see getHelperWorkspace(String)
for detailspublic static LayerWorkspaceMgr noWorkspaces()
public static LayerWorkspaceMgr noWorkspacesImmutable()
Copyright © 2018. All rights reserved.