tf.dtypes.cast

import tensorflow as tf 



x = tf.constant([1.8, 2.2], dtype=tf.float32)
c=tf.dtypes.cast(x, tf.int32)
print(tf.keras.backend.eval(c))

posted @ 2022-08-19 22:51  luoganttcc  阅读(10)  评论(0)    收藏  举报