我正在尝试一个操作不符合预期的操作。
graph = tf.Graph()
with graph.as_default():
train_dataset = tf.placeholder(tf.int32, shape=[128, 2])
embeddings = tf.Variable(
tf.random_uniform([50000, 64], -1.0, 1.0))
embed = tf.nn.embedding_lookup(embeddings, train_dataset)
embed = tf.reduce_sum(embed, reduction_indices=0)
所以我需要知道张量的尺寸embed
。我知道可以在运行时完成,但是对于这样一个简单的操作而言,这是太多的工作。有什么更简单的方法呢?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句