我有一个张量“idx”,它是作为下面代码的结果返回的。代码使用了另外三个名为“result”、“theta”和“user”的张量,下面的输出描述了这三个张量。我是tensorflow的新手,我正在尝试理解idx是什么,文档中对shape=(1,)是什么有点不清楚。它是一个向量,还是一个矩阵?有没有办法访问idx的元素?我尝试了idx1或idx1,但我遇到了超出界限的错误。
任何建议都是非常感谢的。
Code:
result
Output:
<tf.Tensor 'DVBPR_1/Add_2:0' shape=(1, 100) dtype=float32>
Code:
thetau
Output:
<tf.Variable 'DVBPR/Variable:0' shape=(20, 100) dtype=float32_ref>
Code:
user
Output:
<tf.Tensor 'Placeholder_3:0' shape=(1,) dtype=int32>
Code:
idx = tf.reduce_sum(tf.matmul(result,tf.transpose(tf.gather(thetau,user))),1)
idx
Output:
<tf.Tensor 'Sum_1:0' shape=(1,) dtype=float32>https://stackoverflow.com/questions/51297190
复制相似问题