public class WorkspaceUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertNoWorkspacesOpen(String msg)
Assert that no workspaces are currently open
|
static void |
assertNoWorkspacesOpen(String msg,
boolean allowScopedOut)
Assert that no workspaces are currently open
|
static void |
assertOpenActiveAndCurrent(@NonNull String ws,
@NonNull String errorMsg)
Assert that the specified workspace is open, active, and is the current workspace
|
static void |
assertOpenAndActive(@NonNull String ws,
@NonNull String errorMsg)
Assert that the specified workspace is open and active
|
static void |
assertValidArray(INDArray array,
String msg)
Assert that the specified array is valid, in terms of workspaces: i.e., if it is attached (and not in a circular
workspace), assert that the workspace is open, and that the data is not from an old generation.
|
public static void assertNoWorkspacesOpen(String msg) throws ND4JWorkspaceException
msg - Message to include in the exception, if requiredND4JWorkspaceExceptionpublic static void assertNoWorkspacesOpen(String msg, boolean allowScopedOut) throws ND4JWorkspaceException
msg - Message to include in the exception, if requiredallowScopedOut - If true: don't fail if we have an open workspace but are currently scoped outND4JWorkspaceExceptionpublic static void assertOpenAndActive(@NonNull
@NonNull String ws,
@NonNull
@NonNull String errorMsg)
throws ND4JWorkspaceException
ws - Name of the workspace to assert open and activeerrorMsg - Message to include in the exception, if requiredND4JWorkspaceExceptionpublic static void assertOpenActiveAndCurrent(@NonNull
@NonNull String ws,
@NonNull
@NonNull String errorMsg)
throws ND4JWorkspaceException
ws - Name of the workspace to assert open/active/currenterrorMsg - Message to include in the exception, if requiredND4JWorkspaceExceptionpublic static void assertValidArray(INDArray array, String msg)
array - Array to checkmsg - Message (prefix) to include in the exception, if required. May be nullCopyright © 2021. All rights reserved.