Skip to content

Commit 26c518e

Browse files
author
Han Wang
committed
fix: address CodeQL and coderabbit review comments
Remove unused variables (actual_nall, threshold) flagged by CodeQL. Use trainer._optimizer_step() instead of trainer.optimizer.step() in the dynamic-shapes test to match the real training path.
1 parent 89c83d2 commit 26c518e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/tests/pt_expt/test_training.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def test_compiled_handles_varying_nall(self) -> None:
204204
lr = trainer.scheduler.get_last_lr()[0]
205205
_, loss, _more_loss = trainer.wrapper(**inp, cur_lr=lr, label=lab)
206206
loss.backward()
207-
trainer.optimizer.step()
207+
trainer._optimizer_step()
208208

209209
# Loss should be a finite scalar
210210
self.assertFalse(torch.isnan(loss))

0 commit comments

Comments
 (0)