# orbit.utils.LoopFnWithSummaries

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/orbit/utils/loop_fns.py#L199-L212) |

Implements a two-program approach for optimizing summaries on TPU.

Inherits From: [`OptionalSummariesFunction`](https://www.tensorflow.org/api_docs/python/orbit/utils/OptionalSummariesFunction)

    orbit.utils.LoopFnWithSummaries(
        function, **tf_function_kwargs
    )

This version works with the result of `create_tf_while_loop_fn`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `function` | The underlying function to wrap. |
| `**tf_function_kwargs` | Additional arguments to pass to [`tf.function`](https://www.tensorflow.org/api_docs/python/tf/function). |

<br />

## Methods

### `__call__`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/orbit/utils/loop_fns.py#L205-L212)

    __call__(
        iterator, num_steps
    )

Call self as a function.