LatencyExecutionObserver

Simple observer that records per-operation latency using the monotonic clock.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override 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 override fun onOpError(context: ExecutionContext, opName: String, error: Throwable)

Called if the backend throws while evaluating an operation.

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

Called before the backend executes an operation.

Link copied to clipboard
open override fun reset()

Clears any recorded measurements.

Link copied to clipboard

Returns a snapshot of the collected latency measurements.