tensorflow中list转换为tensor
tensorflow
一个面向所有人的开源机器学习框架
项目地址:https://gitcode.com/gh_mirrors/te/tensorflow
免费下载资源
·
a = tf.reshape(b, [1, -1])
I don't know how many columes it can be, but I only want one row. Or
a = tf.reshape(b, [-1, 3])
I don't know how many rows it can be, but I want 3 columes.
More examples for -1
>>> a = np.array([[1,2,3], [4,5,6]])
>>> np.reshape(a, (3,-1)) # the unspecified value is inferred to be 2
array([[1, 2],
[3, 4],
[5, 6]])
>>> a = np.arange(6).reshape((-1, 2))
>>> a
array([[0, 1],
[2, 3],
[4, 5]])
二维 trick
mask = tf.reshape(mask, [tf.shape(mask)[0], -1])
GitHub 加速计划 / te / tensorflow
184.55 K
74.12 K
下载
一个面向所有人的开源机器学习框架
最近提交(Master分支:2 个月前 )
a49e66f2
PiperOrigin-RevId: 663726708
2 个月前
91dac11a
This test overrides disabled_backends, dropping the default
value in the process.
PiperOrigin-RevId: 663711155
2 个月前
更多推荐
已为社区贡献3条内容
所有评论(0)