h = [[312312312.7],[321423423.4]]
h = tf.cast(h, dtype=tf.float32)
j = tf.bitcast(h, tf.int32)
print(j)
其中h中的 float是将int转成byte,再转成float32的,所以底层存的还是字节码,现在可以将其还原。
tf.Tensor( [[1301605392] [1301890114]], shape=(2, 1), dtype=int32)
h = [[312312312.7],[321423423.4]]
h = tf.cast(h, dtype=tf.float32)
j = tf.bitcast(h, tf.int32)
print(j)
其中h中的 float是将int转成byte,再转成float32的,所以底层存的还是字节码,现在可以将其还原。
tf.Tensor( [[1301605392] [1301890114]], shape=(2, 1), dtype=int32)