neuralqx.utils.io.runtime_loggers.deferred_runtime_log module

class DeferredRuntimeLog

Bases: RuntimeLog

RuntimeLog variant that can defer history accumulation until flush.

When defer_accumulation is enabled, per-step payloads are stored as raw entries and converted into History objects only when flush(), serialize() or data access is requested.

property defer_accumulation: bool

Whether per-step accumulation is deferred to flush.

set_deferred_accumulation(enabled)

Enable/disable deferred accumulation mode.

Disabling deferred mode materializes any pending entries immediately.

Return type:

None

property data: dict[str, Any]

The dictionary of logged data.

flush(variational_state=None)

Flushes the data that is stored internally to disk/network.

Parameters:

variational_state – optional variational state from which additional data might be extracted.

serialize(path)

Serialize the content of data to a file.

If the file already exists, it is overwritten.

Parameters:

path – The path of the output file. It must be a valid path.