<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/core/train_utils.py#L522-L569) |

Counts and returns model FLOPs.

    tfm.core.train_utils.try_count_flops(
        model: Union[tf.Module, tf_keras.Model],
        inputs_kwargs: Optional[Dict[str, Any]] = None,
        output_path: Optional[str] = None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `model` | A model instance. |
| `inputs_kwargs` | An optional dictionary of argument pairs specifying inputs' shape specifications to getting corresponding concrete function. |
| `output_path` | A file path to write the profiling results to. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The model's FLOPs. ||

<br />