Skip to content

Commit

Permalink
#6358 Fix issue with LayerWorkspaceMgr when used directly in conjunct…
Browse files Browse the repository at this point in the history
…ion with CuDNN
  • Loading branch information
AlexDBlack committed Sep 5, 2018
1 parent a077937 commit 0c21d7c
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -96,7 +96,7 @@ public INDArray validateArrayLocation(@NonNull ArrayType arrayType, @NonNull IND
* @return Pointer for that key, or null if none exists
*/
public <T extends Pointer> T getHelperWorkspace(String key){
return (T)helperWorkspacePointers.get(key);
return helperWorkspacePointers == null ? null : (T)helperWorkspacePointers.get(key);
}

/**
Expand All @@ -108,6 +108,9 @@ public <T extends Pointer> T getHelperWorkspace(String key){
* @param value Pointer
*/
public void setHelperWorkspace(@NonNull String key, Pointer value){
if(helperWorkspacePointers == null){
helperWorkspacePointers = new HashMap<>();
}
helperWorkspacePointers.put(key, value);
}

Expand Down

0 comments on commit 0c21d7c

Please sign in to comment.