CompilationReport#
- class braintrace.CompilationReport(graph)#
A read-only view over a compiled
ETraceGraph.- Parameters:
graph (
ETraceGraph) – The compiled eligibility-trace graph to summarise.
Notes
All properties are derived on access from
graph; the report stores no independent state.to_str(1)renders the full structural summary (hidden groups, dynamic states, eligibility-trace weights, excluded weights);to_str(2)additionally appends WARNING/ERROR compiler diagnostics.Examples
>>> import brainstate, jax.numpy as jnp, braintrace >>> gru = braintrace.nn.GRUCell(3, 4) >>> _ = brainstate.nn.init_all_states(gru) >>> graph = braintrace.compile_etrace_graph(gru, jnp.ones((3,))) >>> report = braintrace.CompilationReport(graph) >>> report.counts['hidden_groups'] >= 1 True
- property diagnostics: Tuple[CompilationRecord, ...]#
The structured compiler diagnostics, in emission order.
- property dynamic_states: List[Tuple[str, ...]]#
ShortTermStatepaths that are not part of any hidden group.
- property etrace_weights: List[Tuple[Tuple[str, ...], List[int]]]#
List of
(weight_path, [group_index, ...])for ETP-routed weights.
- property excluded_weights: List[Tuple[Tuple[str, ...], str | None]]#
ParamStatepaths not routed through any ETP op, with a reason if known.
- property graph: ETraceGraph#
The wrapped
ETraceGraph.
List of
(group_index, hidden_paths)for each hidden group.