未验证 提交 0675971d 编写于 作者: T Tingquan Gao 提交者: GitHub

rm fluid api (#2907)

上级 962c540c
...@@ -310,8 +310,9 @@ class AdamW(object): ...@@ -310,8 +310,9 @@ class AdamW(object):
if self.one_dim_param_no_weight_decay: if self.one_dim_param_no_weight_decay:
self.no_weight_decay_param_name_list += [ self.no_weight_decay_param_name_list += [
p.name for model in model_list p.name
for n, p in model.named_parameters() if len(p.shape) == 1 for model in model_list for n, p in model.named_parameters()
if len(p.shape) == 1
] if model_list else [] ] if model_list else []
opt = optim.AdamW( opt = optim.AdamW(
...@@ -374,7 +375,7 @@ class AdamWDL(object): ...@@ -374,7 +375,7 @@ class AdamWDL(object):
name_dict=None, name_dict=None,
name=None): name=None):
if not isinstance(layerwise_decay, float) and \ if not isinstance(layerwise_decay, float) and \
not isinstance(layerwise_decay, fluid.framework.Variable): not isinstance(layerwise_decay, paddle.static.Variable):
raise TypeError("coeff should be float or Tensor.") raise TypeError("coeff should be float or Tensor.")
self.layerwise_decay = layerwise_decay self.layerwise_decay = layerwise_decay
self.name_dict = name_dict self.name_dict = name_dict
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册