Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 35196e0

Browse files
bfineranmarkurtz
authored andcommitted
setter function for quant enable_on_initialize (#203)
* setter function for quant enable_on_initialize * format docstring * update docstring
1 parent 4a99a4b commit 35196e0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/sparseml/pytorch/optim/modifier_quantization.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ def enable_on_initialize(self) -> bool:
218218
"""
219219
return self._enable_on_initialize
220220

221+
@enable_on_initialize.setter
222+
def enable_on_initialize(self, value: bool):
223+
"""
224+
:params value: True if QAT should be enabled when this modifier is initialized,
225+
False otherwise. If true, start_epoch will not be respected
226+
"""
227+
self._enable_on_initialize = value
228+
221229
def initialize(self, module: Module, optimizer: Optimizer):
222230
"""
223231
Grab the module / submodule to perform QAT on

0 commit comments

Comments
 (0)