File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,10 @@ def _callback_lookup_(op):
220
220
:return: callback function
221
221
"""
222
222
if op .type == 'parallel_do' and op .attr ('use_nccl' ):
223
+ all_vars = op .block .vars
223
224
param_names = set (op .input ('parameters' ))
225
+ param_names = filter (lambda name : all_vars [name ].stop_gradient is False ,
226
+ param_names )
224
227
param_grad_names = [n + "@GRAD" for n in param_names ]
225
228
226
229
class ParallelDoCallBack (object ):
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ def __network__():
170
170
x = fluid .layers .data (shape = [784 ], dtype = 'float32' , name = 'img' )
171
171
x = yield x
172
172
hidden = fluid .layers .fc (input = x , size = 200 , param_attr = 'fc1.w' )
173
+ hidden = fluid .layers .batch_norm (input = hidden )
173
174
loss = fluid .layers .mean (hidden )
174
175
yield loss
175
176
You can’t perform that action at this time.
0 commit comments