# tf.summary.FileWriterCache

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/summary/writer/writer_cache.py#L29-L64) |

Cache for file writers.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.summary.FileWriterCache`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/summary/FileWriterCache)

<br />

This class caches file writers, one per directory.

## Methods

### `clear`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/summary/writer/writer_cache.py#L40-L48)

    @staticmethod
    clear()

Clear cached summary writers. Currently only used for unit tests.

### `get`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/summary/writer/writer_cache.py#L50-L64)

    @staticmethod
    get(
        logdir
    )

Returns the FileWriter for the specified directory.

<br />

<br />

<br />

| Args ||
|---|---|
| `logdir` | str, name of the directory. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A `FileWriter`. ||

<br />