continual.call_mode¶
- continual.call_mode = <continual.module._CallModeContext object>¶
Context-manager which temporarily specifies a call_mode
When the call_mode context is used, the
__call__
function of continual modules with be set accordinglyExample:
sequence = torch.randn(1, 3, 10) step = sequence[:, :, -1] forward_output = module(sequence) # Calls `forward` with co.call_mode("forward_step"): forward_step_output = module(step) # Calls `forward_step` forward_output = module(sequence) # Calls `forward`