import numpy as npx = np.array([[[0], [1], [2]]]) print(x.shape)
d = np.squeeze(x) # 从数组的形状中删除单维条目,即把shape中为1的维度去掉print(d.shape)
本文共 183 字,大约阅读时间需要 1 分钟。
import numpy as npx = np.array([[[0], [1], [2]]]) print(x.shape)
d = np.squeeze(x) # 从数组的形状中删除单维条目,即把shape中为1的维度去掉print(d.shape)
转载于:https://www.cnblogs.com/douzujun/p/10274530.html