| 查看: 897 | 回复: 3 | |||
LoseInVain新虫 (初入文坛)
|
[交流]
In tensorflow, how to use the placeholder's value before feeding? 已有1人参与
|
|
在stack overflow里面发了一个问题,现在还没回答比较急,所以这里求助下~~ New to TensorFlow,Now I need to use the value in placeholder before feeding, something like: tensor = tf.placeholder(tf.float32, [None, 3]) Mat_items = tf.Variable(tf.random_normal([10,10])) Mat_users = tf.Variable(tf.random_normal([10,10])) item_index = tensor[:, 0] user_index = tensor[:, 1] rating = tensor[:, 2] Val = Mat_items[item_index, :]-Mat_users[user_index, :] while tensor is a placeholder with N rows 3 cols, first col and second col is the index to Mat_items and Mat_users respectively and Mat_items Mat_users are the Variables needed to be indexed. Running it will absolutely throw an error because item_index, user_index both are Tensor not numeric before feeding. So I wonder whether Tensorflow could realize this demand? Any suggestion will be appreciate! |
» 猜你喜欢
依托企业入选了国家启明计划青年人才。有无高校可以引进的。
已经有5人回复
博士延得我,科研能力直往上蹿
已经有9人回复
遇见不省心的家人很难过
已经有23人回复
天津大学招2026.09的博士生,欢迎大家推荐交流(博导是本人)
已经有6人回复
AI 太可怕了,写基金时,提出想法,直接生成的文字比自己想得深远,还有科学性
已经有6人回复
有院领导为了换新车,用横向课题经费买了俩车
已经有9人回复
酰胺脱乙酰基
已经有13人回复
同年申请2项不同项目,第1个项目里不写第2个项目的信息,可以吗
已经有4人回复
有时候真觉得大城市人没有县城人甚至个体户幸福
已经有10人回复
uerth
铁虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 1805.4
- 红花: 1
- 帖子: 189
- 在线: 188.2小时
- 虫号: 2830772
- 注册: 2013-11-27
- 性别: GG
- 专业: 信息处理方法与技术
2楼2017-06-22 17:25:21
LoseInVain
新虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 99.5
- 帖子: 6
- 在线: 11.7小时
- 虫号: 4308259
- 注册: 2015-12-23
- 性别: GG
- 专业: 信息处理方法与技术
3楼2017-06-23 14:12:57
uerth
铁虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 1805.4
- 红花: 1
- 帖子: 189
- 在线: 188.2小时
- 虫号: 2830772
- 注册: 2013-11-27
- 性别: GG
- 专业: 信息处理方法与技术
4楼2017-06-23 16:42:17













回复此楼