module
Dynamic class for all sparse modules.
Classes
Base dynamic class for all sparse modules. |
- class SparseModule
Bases:
DynamicModule
Base dynamic class for all sparse modules.
- modify(*args, **kwargs)
Initialize the sparsity mask when this is called.
Note that for any module that is not frozen via
None
in the rules, this function will be called. Hence, we use this function to initialize the sparsity mask only when necessary.
- set_mask(value)
Set the active sparse mask of the module weights.
- Parameters:
value (BoolTensor | None) –