# tf.compat.as_str_any

<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#L123-L140) |

Converts input to `str` type.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.compat.as_str_any(
        value, encoding='utf-8'
    )

Uses `str(value)`, except for `bytes` typed inputs, which are converted
using `as_str`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `value` | A object that can be converted to `str`. |
| `encoding` | Encoding for `bytes` typed inputs. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `str` object. ||

<br />