tf.compat.v1.string_to_number

View source on GitHub

Converts each string in the input Tensor to the specified numeric type.

tf.compat.v1.string_to_number(
    string_tensor=None, out_type=tf.dtypes.float32, name=None, input=None
)

(Note that int32 overflow results in an error while float overflow results in a rounded value.)

Args:

Returns:

A Tensor of type out_type.