# tf.compat.as_str

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/util/compat.py#L115-L116) |

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.compat.as_str(
        bytes_or_text, encoding='utf-8'
    )