mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Reset Optimizer counter while deserializing netWithBackwardOptions
Summary: Add ability to reset optimizer counter.. Test Plan: will wait for integration tests to run on diff. Differential Revision: D27248286 fbshipit-source-id: a608df1bd61b64eb317c9ffd9cfdd804c5288f6d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ba9f12d235
commit
f3c00047ce
@ -22,6 +22,14 @@ FP16_ENGINES = ["SIMD_Q_FP16", "SIMD_Q_STOC_FP16", "SIMD_Q_STOC_MKL_FP16"]
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def reset_optimizer_instance_count():
|
||||
"""
|
||||
This function clears the _optimizer_instance_count. And keeps it
|
||||
empty. This functionality is needed in some situations where
|
||||
optimizer instance count might not reset even though the workplace is reset.
|
||||
"""
|
||||
_optimizer_instance_count.clear()
|
||||
|
||||
|
||||
class Optimizer(object):
|
||||
def __init__(self):
|
||||
|
||||
Reference in New Issue
Block a user