Skip to content

Commit

Permalink
Fix: disable/enable act quant
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Jul 7, 2023
1 parent dc47ce1 commit 62b6a58
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def __call__(self, model_input):

handle = self.layer.register_forward_hook(self.data_saver)
self.disable_param_quantization(self.model, is_training=False)
self.disable_act_quantization(self.model, is_training=False)
with torch.no_grad():
try:
_ = self.model(model_input)
Expand All @@ -83,6 +84,7 @@ def __call__(self, model_input):

self.data_saver.store_output = False
self.enable_param_quantization(self.model, is_training=False)
self.enable_act_quantization(self.model, is_training=False)
with torch.no_grad():
try:
_ = self.model(model_input)
Expand Down

0 comments on commit 62b6a58

Please sign in to comment.