我希望通过函数tf.cast()
将float32_ref
类型的word_embeddings修改为float32
类型:
word_embeddings_modify=tf.cast(word_embeddings,dtype=tf.float32)
但是它并没有按预期工作,word_embeddings_modify的数据类型仍为tf.float32_ref。
word_embeddings = tf.scatter_nd_update(var_output, error_word_f,sum_all)
word_embeddings_modify=tf.cast(word_embeddings,dtype=tf.float32)
word_embeddings_dropout = tf.nn.dropout(word_embeddings_2, dropout_pl)