![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
numpy
codeSniper、
这个作者很懒,什么都没留下…
展开
-
tensorflow中的reshape(tensor,[1,-1])和reshape(tensor,[-1,1])
tf.reshape(tensor,[-1,1])将张量变为一维列向量tf.reshape(tensor,[1,-1])将张量变为一维行向量import tensorflow as tfa = [[1,2],[3,4],[5,6]]tf.reshape(a,[-1,1])Out[13]: <tf.Tensor 'Reshape_4:0' shape=(6, 1) ...原创 2019-11-23 17:26:36 · 1325 阅读 · 0 评论 -
numpy扩展维度以及np.concatenate
a = np.arange(12).reshape(3,4)aarray([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]])使用np.reshape()将a由二维扩展到三维.b = np.reshape(a,(3,4,1))barray([[[ 0], [ 1], ...原创 2019-05-02 15:26:03 · 5284 阅读 · 1 评论