Commit 588ea957 authored by Yinan Zhao's avatar Yinan Zhao Committed by Facebook GitHub Bot
Browse files

check disable_observer before updating observers

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/407

As is, observers can be periodically updated even if observer is disabled. Add a check on whether observer is disabled before updating observers periodically.

Reviewed By: tglik

Differential Revision: D40734564

fbshipit-source-id: fd3e50e95c95ad39bd993f71e02dc7acc79744cc
parent 6c1682f9
...@@ -613,6 +613,7 @@ class QATHook(HookBase): ...@@ -613,6 +613,7 @@ class QATHook(HookBase):
if ( if (
self._applied["enable_fake_quant"] self._applied["enable_fake_quant"]
and not self._applied["disable_observer"]
and cfg.QUANTIZATION.QAT.UPDATE_OBSERVER_STATS_PERIODICALLY and cfg.QUANTIZATION.QAT.UPDATE_OBSERVER_STATS_PERIODICALLY
and cur_iter % cfg.QUANTIZATION.QAT.UPDATE_OBSERVER_STATS_PERIOD == 0 and cur_iter % cfg.QUANTIZATION.QAT.UPDATE_OBSERVER_STATS_PERIOD == 0
): ):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment