Commit 41ba7284 authored by Yuxin Wu's avatar Yuxin Wu

Skip empty warning message in FilterNoneGrad

parent b00ea17c
......@@ -70,7 +70,7 @@ class FilterNoneGrad(GradientProcessor):
to_print.append(var.op.name)
else:
g.append((grad, var))
if self._verbose:
if self._verbose and len(to_print):
message = ', '.join(to_print)
logger.warn("No gradient w.r.t these trainable variables: {}".format(message))
return g
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment