# tf_agents.networks.layer_utils.print_summary

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/networks/layer_utils.py#L235-L519) |

Prints a summary of a model.

    tf_agents.networks.layer_utils.print_summary(
        model,
        line_length=None,
        positions=None,
        print_fn=None,
        expand_nested=False,
        show_trainable=False,
        layer_range=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `model` | Keras model instance. |
| `line_length` | Total length of printed lines (e.g. set this to adapt the display to different terminal window sizes). |
| `positions` | Relative or absolute positions of log elements in each line. If not provided, defaults to `[0.3, 0.6, 0.70, 1.]`. |
| `print_fn` | Print function to use. 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). |
| `expand_nested` | Whether to expand the nested models. If not provided, defaults to `False`. |
| `show_trainable` | Whether to show if a layer is trainable. If not provided, defaults to `False`. |
| `layer_range` | List or tuple containing two strings, the starting layer name and ending layer name (both inclusive), indicating the range of layers to be printed in the summary. The strings could also be regexes instead of an exact name. In this case, the starting layer will be the first layer that matches `layer_range[0]` and the ending layer will be the last element that matches `layer_range[1]`. By default (`None`) all layers in the model are included in the summary. |

<br />