Browse Source

删除PaddleDriver.zero_grad对set_to_none的warning

tags/v1.0.0alpha
x54-729 2 years ago
parent
commit
484b932772
1 changed files with 0 additions and 2 deletions
  1. +0
    -2
      fastNLP/core/drivers/paddle_driver/paddle_driver.py

+ 0
- 2
fastNLP/core/drivers/paddle_driver/paddle_driver.py View File

@@ -71,8 +71,6 @@ class PaddleDriver(Driver):


:param set_to_none: 用来判断是否需要将梯度直接置为 None;Paddle中这个参数无效。 :param set_to_none: 用来判断是否需要将梯度直接置为 None;Paddle中这个参数无效。
""" """
if set_to_none:
logger.rank_zero_warning("Parameter `set_to_none` does nothing in paddle since grad cannot be set directly.")
for optimizer in self.optimizers: for optimizer in self.optimizers:
optimizer.clear_grad() optimizer.clear_grad()




Loading…
Cancel
Save