numpy reshape resize用法

 

https://docs.scipy.org/doc/numpy/reference/generated/numpy.resize.html

 

    a = np.zeros((100,28*28))
    print(a.shape)
    b = a.reshape((100,28,28,1))
    print(b.shape)
    b = np.resize(b, (100,28*4,28*4,1))
    print(b.shape)

(100, 784)
(100, 28, 28, 1)
(100, 112, 112, 1)

posted on 2018-08-15 10:09  Maddock  阅读(750)  评论(0编辑  收藏  举报

导航