Skip to content

Commit

Permalink
Don’t put print function in signature
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Jan 9, 2018
1 parent 958239c commit 2bf4a17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion keras/utils/layer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def count_params(weights):
return int(np.sum([K.count_params(p) for p in set(weights)]))


def print_summary(model, line_length=None, positions=None, print_fn=print):
def print_summary(model, line_length=None, positions=None, print_fn=None):
"""Prints a summary of a model.
# Arguments
Expand All @@ -35,7 +35,11 @@ def print_summary(model, line_length=None, positions=None, print_fn=print):
It will be called on each line of the summary.
You can set it to a custom function
in order to capture the string summary.
It defaults to `print` (prints to stdout).
"""
if print_fn is None:
print_fn = print

if model.__class__.__name__ == 'Sequential':
sequential_like = True
else:
Expand Down

0 comments on commit 2bf4a17

Please sign in to comment.