# tf.io.match_filenames_once

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.14.0/tensorflow/python/training/input.py#L56-L76) |

Save the list of files matching pattern, so it is only computed once.

#### View aliases


**Compat aliases for migration**

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

[`tf.compat.v1.io.match_filenames_once`](https://www.tensorflow.org/api_docs/python/tf/io/match_filenames_once), [`tf.compat.v1.train.match_filenames_once`](https://www.tensorflow.org/api_docs/python/tf/io/match_filenames_once)

<br />

    tf.io.match_filenames_once(
        pattern, name=None
    )

> [!NOTE]
> **Note:** The order of the files returned is deterministic.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `pattern` | A file pattern (glob), or 1D tensor of file patterns. |
| `name` | A name for the operations (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A variable that is initialized to the list of files matching the pattern(s). ||

<br />