mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-03 10:06:44 +00:00
[hotfix] fix lr scheduler bug in torch 2.0 (#4864)
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
from torch.optim.lr_scheduler import _LRScheduler
|
||||
import torch
|
||||
from packaging.version import Version
|
||||
|
||||
if Version(torch.__version__) >= Version("2.0.0"):
|
||||
from torch.optim.lr_scheduler import LRScheduler as _LRScheduler
|
||||
else:
|
||||
from torch.optim.lr_scheduler import _LRScheduler
|
||||
|
||||
|
||||
class _enable_get_lr_call:
|
||||
|
Reference in New Issue
Block a user