public class OpBenchmarkListener extends BaseListener
| Modifier and Type | Class and Description |
|---|---|
static class |
OpBenchmarkListener.Mode |
static class |
OpBenchmarkListener.OpExec |
| Constructor and Description |
|---|
OpBenchmarkListener(Operation operation,
@NonNull OpBenchmarkListener.Mode mode) |
OpBenchmarkListener(Operation operation,
@NonNull OpBenchmarkListener.Mode mode,
long minRuntime) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isActive(Operation operation)
Returns whether this listener is active during the given operation.
|
void |
operationEnd(SameDiff sd,
Operation op)
Called at the end of an operation, e.g.
|
void |
operationStart(SameDiff sd,
Operation op)
Called at the start of an operation, e.g.
|
void |
opExecution(SameDiff sd,
At at,
MultiDataSet batch,
SameDiffOp op,
OpContext opContext,
INDArray[] outputs)
Called at the end of each operation execution
|
void |
preOpExecution(SameDiff sd,
At at,
SameDiffOp op,
OpContext opContext)
Called just before each operation is executed (native code called, etc) - after all inputs etc have been set
|
activationAvailable, epochEnd, epochStart, iterationDone, iterationStart, preUpdate, requiredVariables, validationDonepublic OpBenchmarkListener(Operation operation, @NonNull @NonNull OpBenchmarkListener.Mode mode)
public OpBenchmarkListener(Operation operation, @NonNull @NonNull OpBenchmarkListener.Mode mode, long minRuntime)
operation - Operation to collect stats formode - Mode - see OpBenchmarkListenerminRuntime - Minimum runtime - only applies to Mode.SINGLE_ITER_PRINT. If op runtime below this: don't printpublic boolean isActive(Operation operation)
Listenerpublic void operationStart(SameDiff sd, Operation op)
ListeneroperationStart in interface ListeneroperationStart in class BaseListenersd - The SameDiff instanceop - The operation being startedpublic void operationEnd(SameDiff sd, Operation op)
ListeneroperationEnd in interface ListeneroperationEnd in class BaseListenersd - The SameDiff instanceop - The operation being startedpublic void preOpExecution(SameDiff sd, At at, SameDiffOp op, OpContext opContext)
ListenerpreOpExecution in interface ListenerpreOpExecution in class BaseListenersd - The SameDiff instanceat - Current iteration/epoch etcop - Operation that has just been executedpublic void opExecution(SameDiff sd, At at, MultiDataSet batch, SameDiffOp op, OpContext opContext, INDArray[] outputs)
ListenerNote: Outputs will most likely be freed later, use detach() if you need to save it.
opExecution in interface ListeneropExecution in class BaseListenersd - The SameDiff instanceat - Current iteration/epoch etcbatch - The batch's input data. May be null if not called with a batchop - Operation that has just been executedoutputs - The output arrays for the just-executed operationCopyright © 2021. All rights reserved.