Converts each entry in the given tensor to strings.
View aliases
Main aliases
Compat aliases for migrationSee Migration guide for more details.
tf.compat.v1.as_string
, tf.compat.v1.dtypes.as_string
, tf.compat.v1.strings.as_string
tf.strings.as_string(
input: Annotated[Any, TV_AsString_T],
precision: int = -1,
scientific: bool = False,
shortest: bool = False,
width: int = -1,
fill: str = '',
name=None
) -> Annotated[Any, _atypes.String]
Used in the notebooks
Used in the guide | Used in the tutorials |
---|---|
Supports many numeric types and boolean.
For Unicode, see the https://www.tensorflow.org/tutorials/representation/unicode tutorial.
Examples:
tf.strings.as_string([3, 2])
<tf.Tensor: shape=(2,), dtype=string, numpy=array([b'3', b'2'], dtype=object)>
tf.strings.as_string([3.1415926, 2.71828], precision=2).numpy()
array([b'3.14', b'2.72'], dtype=object)
Returns | |
---|---|
A Tensor of type string .
|