Added expand_nested feature in model.summary()
@@ -2510,7 +2510,9 @@ class Model(base_layer.Layer, version_utils.ModelVersionSelector):
weights += (self._trainable_weights + self._non_trainable_weights)
return weights
- def summary(self, line_length=None, positions=None, print_fn=None):
+ def summary(self, line_length=None,
+ positions=None, print_fn=None,
+ expand_nested=False):
"""Prints a string summary of the network.
Args:
@@ -2524,6 +2526,8 @@ class Model(base_layer.Layer, version_utils.ModelVersionSelector):
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.
+ expand_nested: Whether to expand the nested models.
+ If not provided, defaults to `False`.
Raises:
ValueError: if `summary()` is called before the model is built.
@@ -2537,7 +2541,8 @@ class Model(base_layer.Layer, version_utils.ModelVersionSelector):
layer_utils.print_summary(self,
line_length=line_length,
positions=positions,
- print_fn=print_fn)
+ print_fn=print_fn,
+ expand_nested=expand_nested)
@property
def layers(self):
