张量转换要求dtype float32_ref为具有dtype float32的张量?
word_embeddings = tf.scatter_nd_update(var_output, error_word_f, sum_all)
word_embeddings_2 = tf.nn.dropout(word_embeddings, self.dropout_pl)
错误提示如下:
ValueError: Tensor conversion requested dtype float32_ref for Tensor with dtype float32: 'Tensor("dropout:0", shape=(), dtype=float32)
看起来word_embeddings
的dtype是float32_ref,但实际的功能tf.nn.dropout
需要word_embeddings
的dtype float32,我如何才能将word_embeddings
的dtype的float32_ref转换为float32运行tf.nn.dropout(word_embeddings, self.dropout_pl)
?