tf.string_to_number:将字符串转换为数字
tf.to_double:转换为双精度浮点数类型
tf.to_float:转换为浮点数
tf.to_bfloat16:转换为bfloat16格式的浮点。该浮点数格式的介绍请见这篇文章:深度学习与bfloat16
tf.to_int32:转换为32位的整型数
tf.to_int64:转换为64位的整型数
tf.cast:转换为指定类型的数
tf.bitcast:在不复制数据的情况下,在原地进行类型转换
tf.saturate_cast:在不进行任何缩放的情况下,进行类型转换
tf.string_to_number函数
tf.string_to_number(
string_tensor,
out_type=tf.float32,
name=None
)
tf.to_double函数
tf.to_double(
x,
name=