xnn.common.models.fast.FastPathModule#
- class xnn.common.models.fast.FastPathModule[source]#
Bases:
objectMixin of a module with a reference and a fast implementation.
A fast-path module subclasses its reference module (so its parameters and
state_dictare the reference ones) and this mixin. It implements the fast evaluation in methods marked@torch.jit.unusedand branches onfast_active, which the owning model sets before each evaluation (seeselect()); its__init__setsself.fast_active = False. Under TorchScript the flag is alwaysFalse.- Variables:
fast_active (bool) – Whether the next evaluation uses the fast path.