slapo.pattern¶
Classes:
|
|
|
- class slapo.pattern.Pattern(*args, **kwargs)[source]¶
Methods:
forward
(*args)Defines the computation performed at every call.
- Return type
None
- forward(*args)[source]¶
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class slapo.pattern.ModulePattern(name)[source]¶
Methods:
forward
(*args)Defines the computation performed at every call.
- forward(*args)[source]¶
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.