How to convert tf.int64 to tf.float32?

You can cast generally using:

tf.cast(my_tensor, tf.float32)

Replace tf.float32 with your desired type.


Edit: It seems at the moment at least, that tf.cast won’t cast to an unsigned dtype (e.g. tf.uint8). To work around this, you can cast to the signed equivalent and used tf.bitcast to get all the way. e.g.

tf.bitcast(tf.cast(my_tensor, tf.int8), tf.uint8)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)