nvalchemi.hooks.DynamicsContext#
- class nvalchemi.hooks.DynamicsContext(*, batch, model=None, global_rank=0, workflow=None, step_count=0, converged_mask=None, active_graph_mask=None, graduated_mask=None)[source]#
Context object passed to dynamics hooks.
- Parameters:
batch (Batch | None)
model (BaseModelMixin | None)
global_rank (int)
workflow (Any)
step_count (int)
converged_mask (Bool[torch.Tensor, 'B'] | None)
active_graph_mask (Bool[torch.Tensor, 'B'] | None)
graduated_mask (Bool[torch.Tensor, 'B'] | None)
- step_count#
Current dynamics step number.
- Type:
int
- converged_mask#
Boolean mask of samples that converged at the current hook stage.
Nonewhen convergence has not fired for this dispatch.- Type:
Bool[torch.Tensor, “B”] | None
- active_graph_mask#
Boolean mask of shape
(batch.num_graphs,)selecting graphs active in the current dynamics dispatch.Nonewhen the dispatch has no status-based filtering (typically standaloneBaseDynamics). In aFusedStagesubstage, it selects graphs whose status matches that substage.- Type:
Bool[torch.Tensor, “B”] | None
- graduated_mask#
Boolean mask of shape
(batch.num_graphs,)selecting the graphs that graduated during the current step, meaning their status reached the engine’sexit_status. Set only forON_GRADUATEdispatches, where it may be allFalse;Noneat every other stage.- Type:
Bool[torch.Tensor, “B”] | None