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)

猜你喜欢

转载自www.cnblogs.com/adong7639/p/9479817.html
今日推荐