Skip to content

Commit 4f82667

Browse files
committed
update: raise ValueError
1 parent 8047e9f commit 4f82667

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pytorch_optimizer/optimizer/adai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
125125
exp_avg_sq_hat_sum += exp_avg_sq.sum() / bias_correction2
126126

127127
if param_size == 0:
128-
raise ZeroDivisionError('[-] param_size is 0')
128+
raise ValueError('[-] param_size is 0')
129129

130130
exp_avg_sq_hat_mean = exp_avg_sq_hat_sum / param_size
131131

pytorch_optimizer/optimizer/ranger21.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
236236

237237
# stable weight decay
238238
if param_size == 0:
239-
raise ZeroDivisionError('[-] param_size is 0')
239+
raise ValueError('[-] param_size is 0')
240240

241241
variance_normalized = math.sqrt(variance_ma_sum / param_size)
242242
if math.isnan(variance_normalized):

0 commit comments

Comments
 (0)