# tensorflow::ops::AsString Class Reference

# tensorflow::
ops::
AsString

`
#include <string_ops.h>
`


Converts each entry in the given tensor to strings.

## Summary


Supports many numeric types and boolean.


For Unicode, see the \[
<https://www.tensorflow.org/tutorials/representation/unicode>
\](Working with Unicode text) tutorial.


Examples:


tf.strings.as_string(\[3, 2\])
tf.strings.as_string(\[3.1415926, 2.71828\], precision=2).numpy() array(\[b'3.14', b'2.72'\], dtype=object)


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object

<br />


Optional attributes (see
`
https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs
`
):

- precision: The post-decimal precision to use for floating point numbers. Only used if precision \> -1.
- scientific: Use scientific notation for floating point numbers.
- shortest: Use shortest representation (either scientific or standard) for floating point numbers.
- width: [Pad](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/pad#classtensorflow_1_1ops_1_1_pad) pre-decimal numbers to this width. Applies to both floating point and integer numbers. Only used if width \> -1.
- fill: The value to pad if width \> -1. If empty, pads with spaces. Another typical value is '0'. String cannot be longer than 1 character.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : The output tensor.

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1a93703cfbec4867fde47aa2259770786d (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input input) ` ||
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1a48e83706cffb25050240d9ae8e2d84e4 (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input input, const https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1a4f40ee7fcae884138385d66946669132 ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1afd5f84ceab758a320b25af91eb1614ff ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1abb163457f3457bfe14dd5192aeced5c5 () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1a25d4641309fe3d0f801105ad0b3027be () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1a0b6fa38b640976c2d6651a9a96ae9fec () const ` | ` ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1ac3d8aab67abdc6322377e5d914aa3124 (StringPiece x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1aa3a1688f03e1afc119452b92d96054ff (int64 x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1a258997efffeb32c7733aaeef5f6b3614 (bool x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1acfa9078d608f2939a48684fbf6607558 (bool x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string_1a5c6d3289fae480ee2909b51f14351bf5 (int64 x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs ` |

| ### Structs ||
|---|---|
| [tensorflow:: ops:: AsString:: Attrs](https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/as-string/attrs) | Optional attribute setters for [AsString](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string) . |

## Public attributes

### operation

```
Operation operation
```

### output

```
::tensorflow::Output output
```

## Public functions

### AsString

```
 AsString(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input
)
```

### AsString

```
 AsString(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  const AsString::Attrs & attrs
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```

## Public static functions

### Fill

```
Attrs Fill(
  StringPiece x
)
```

### Precision

```
Attrs Precision(
  int64 x
)
```

### Scientific

```
Attrs Scientific(
  bool x
)
```

### Shortest

```
Attrs Shortest(
  bool x
)
```

### Width

```
Attrs Width(
  int64 x
)
```