liumaolin
commited on
Commit
·
26079e1
1
Parent(s):
8630353
Refactor import statement in `lr_schedulers.py`: move `matplotlib` import to main guard to reduce unnecessary module loading.
Browse files
third_party/moyoyo_tts/AR/modules/lr_schedulers.py
CHANGED
|
@@ -3,7 +3,6 @@
|
|
| 3 |
import math
|
| 4 |
|
| 5 |
import torch
|
| 6 |
-
from matplotlib import pyplot as plt
|
| 7 |
from torch import nn
|
| 8 |
from torch.optim import Adam
|
| 9 |
|
|
@@ -67,6 +66,7 @@ class WarmupCosineLRSchedule(torch.optim.lr_scheduler._LRScheduler):
|
|
| 67 |
|
| 68 |
|
| 69 |
if __name__ == "__main__":
|
|
|
|
| 70 |
m = nn.Linear(10, 10)
|
| 71 |
opt = Adam(m.parameters(), lr=1e-4)
|
| 72 |
s = WarmupCosineLRSchedule(
|
|
|
|
| 3 |
import math
|
| 4 |
|
| 5 |
import torch
|
|
|
|
| 6 |
from torch import nn
|
| 7 |
from torch.optim import Adam
|
| 8 |
|
|
|
|
| 66 |
|
| 67 |
|
| 68 |
if __name__ == "__main__":
|
| 69 |
+
from matplotlib import pyplot as plt
|
| 70 |
m = nn.Linear(10, 10)
|
| 71 |
opt = Adam(m.parameters(), lr=1e-4)
|
| 72 |
s = WarmupCosineLRSchedule(
|