<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/ops/summary_ops_v2.py#L520-L594) |

Creates a summary file writer for the given log directory.

    tf.summary.create_file_writer(
        logdir,
        max_queue=None,
        flush_millis=None,
        filename_suffix=None,
        name=None,
        experimental_trackable=False,
        experimental_mesh=None
    )

### Used in the notebooks

| Used in the guide | Used in the tutorials |
|---|---|
| - [Introduction to modules, layers, and models](https://www.tensorflow.org/guide/intro_to_modules) | - [pix2pix: Image-to-image translation with a conditional GAN](https://www.tensorflow.org/tutorials/generative/pix2pix) - [Migrating tf.summary usage to TF 2.x](https://www.tensorflow.org/tensorboard/migrate) - [Displaying image data in TensorBoard](https://www.tensorflow.org/tensorboard/image_summaries) - [TensorBoard Scalars: Logging training metrics in Keras](https://www.tensorflow.org/tensorboard/scalars_and_keras) - [Displaying text data in TensorBoard](https://www.tensorflow.org/tensorboard/text_summaries) |

<br />

<br />

<br />

| ## Args ||
|---|---|
| `logdir` | a string specifying the directory in which to write an event file. |
| `max_queue` | the largest number of summaries to keep in a queue; will flush once the queue gets bigger than this. Defaults to 10. |
| `flush_millis` | the largest interval between flushes. Defaults to 120,000. |
| `filename_suffix` | optional suffix for the event file name. Defaults to `.v2`. |
| `name` | a name for the op that creates the writer. |
| `experimental_trackable` | a boolean that controls whether the returned writer will be a `TrackableResource`, which makes it compatible with SavedModel when used as a [`tf.Module`](https://www.tensorflow.org/api_docs/python/tf/Module) property. |
| `experimental_mesh` | a [`tf.experimental.dtensor.Mesh`](https://www.tensorflow.org/api_docs/python/tf/experimental/dtensor/Mesh) instance. When running with DTensor, the mesh (experimental_mesh.host_mesh()) will be used for bringing all the DTensor logging from accelerator to CPU mesh. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A SummaryWriter object. ||

<br />