tf.cast()函数的作用是执行 tensorflow 中张量数据类型转换,比如读入的图片如果是int8类型的,一般在要在训练前把图像的数据格式转换为float32。
cast(x, dtype, name=None)
详细见:https://blog.csdn.net/dcrmg/article/details/79747814