tf.raw_ops.AsString
Stay organized with collections
Save and categorize content based on your preferences.
Converts each entry in the given tensor to strings.
tf.raw_ops.AsString(
input,
precision=-1,
scientific=False,
shortest=False,
width=-1,
fill='',
name=None
)
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)
Args |
input
|
A Tensor . Must be one of the following types: float32 , float64 , int32 , uint8 , int16 , int8 , int64 , bfloat16 , uint16 , half , uint32 , uint64 , complex64 , complex128 , bool , variant , string .
|
precision
|
An optional int . Defaults to -1 .
The post-decimal precision to use for floating point numbers.
Only used if precision > -1.
|
scientific
|
An optional bool . Defaults to False .
Use scientific notation for floating point numbers.
|
shortest
|
An optional bool . Defaults to False .
Use shortest representation (either scientific or standard) for
floating point numbers.
|
width
|
An optional int . Defaults to -1 .
Pad pre-decimal numbers to this width.
Applies to both floating point and integer numbers.
Only used if width > -1.
|
fill
|
An optional string . Defaults to "" .
The value to pad if width > -1. If empty, pads with spaces.
Another typical value is '0'. String cannot be longer than 1 character.
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor of type string .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[],[]]