添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
宽容的凉茶  ·  卫通大厦·  6 月前    · 
很拉风的红酒  ·  Microsoft Word: ...·  7 月前    · 
成熟的充电器  ·  CEC Juniper Community·  8 月前    · 

@Nick_Young yes, the buffer for the gradient are never zeroed out automatically.
@lgelderloos only if you created your optimizer as optimizer = optim.some_optim_func(model.parameters(), ...) . Basically model.zero_grad() will zero all the parameters in the model. optimizer.zero_grad() will zero out all parameters associated with this optimizer. Depending on how you created the optimizer, they will be the same or not.