小编Mar*_*edt的帖子

Tensorflow元组具有不同的形状

我有一个问题,返回一个两个变量的元组v,wt其中vhas shape=(20,20)wthas shape=(1,).wt是一个重量值的变量.我想在一个内部返回元组(v,wt)map_fn

我的代码看起来有点接近这个

tf.map_fn(fn, nonzeros(Matrix, dim, row))

nonzeros(Matrix, dim, row) returns a (index, value)
Run Code Online (Sandbox Code Playgroud)

fn会返回一个元组,但错误输出我得到的是:

ValueError: The two structures don't have the same number of elements. First 
structure: <dtype: 'int64'>, second structure: (<tf.Tensor 
'map_2/while/while/Exit_1:0' shape=(20,) dtype=float32>, <tf.Tensor 
'map_2/while/Sub:0' shape=() dtype=int64>).
Run Code Online (Sandbox Code Playgroud)

python factorization tensorflow

5
推荐指数
1
解决办法
796
查看次数

使用所有者在Microsoft Graph API中创建一个组

我有一个Office 365组,我想通过Microsoft Graph API添加.基于API文档,我相信我需要

POST https://graph.microsoft.com/v1.0/groups
Content-type: application/json
Content-length: 244
Run Code Online (Sandbox Code Playgroud)
{
  "description": "Self help community for library",
  "displayName": "Library Assist",
  "groupTypes": [
    "Unified"
  ],
  "mailEnabled": true,
  "mailNickname": "library",
  "securityEnabled": false
}
Run Code Online (Sandbox Code Playgroud)

但是当我尝试添加时

"owner": [{ "@odata.id": "https://graph.microsoft.com/v1.0/users/{id}"}]
Run Code Online (Sandbox Code Playgroud)

我收到一个错误(该ID实际上是办公室中存在的ID,所以我不想把它放在这里).

如果我首先运行创建组然后添加所有者但不在一起,它们可以工作.为什么?

想尽可能让我这么容易.我将邮递员放在标签中只是因为那是我目前正在使用的工具

microsoft-graph

2
推荐指数
2
解决办法
1876
查看次数

在TensorFlow中使用coo_matrix

我在TensorFlow中进行矩阵分解,我想使用来自Spicy.sparse的coo_matrix,因为它使用更少的内存,并且可以很容易地将我的所有数据放入我的矩阵中来训练数据.

是否可以使用coo_matrix来初始化张量流中的变量?

或者我是否必须使用sess.run()和feed_dict创建会话并将我获得的数据提供给tensorflow.

我希望你理解我的问题和我的问题否则评论,我会尝试解决它.

sparse-matrix matrix-factorization tensorflow

1
推荐指数
1
解决办法
3412
查看次数