use

suspend fun use(stagesTotal: Int? = null, block: suspend StageScope<Input, Output, InputLabel>.() -> Unit): TrainingResult

Runs the training session: sets up the root StageScope, runs block, persists final records, and returns the TrainingResult.

If block throws, the exception is re-thrown after the partial records are saved with executionMetadata.completed = false and rootRecord.failure populated.

Parameters

stagesTotal

Expected number of root stages, used for progress / ETC calculation. null means the total is unknown.