ExecutionObserver

Observer that can tap into execution events produced by an ExecutionContext.

Implementations can be used to collect metrics, trace operations or build higher-level benchmark tooling.

Inheritors

Functions

Link copied to clipboard
open fun onOpEnd(context: ExecutionContext, opName: String, result: Any?)

Called after a successful operation. result can be a single tensor, a collection of tensors, or any backend specific payload.

Link copied to clipboard
open fun onOpError(context: ExecutionContext, opName: String, error: Throwable)

Called if the backend throws while evaluating an operation.

Link copied to clipboard
open fun onOpStart(context: ExecutionContext, opName: String, inputs: List<Tensor<*, *>>)

Called before the backend executes an operation.

Link copied to clipboard
open fun onTensorMaterialized(context: ExecutionContext, tensor: Tensor<*, *>)

Called whenever a tensor is materialised inside the context (e.g. as the result of an operation or via factory helpers).