2024-09-20 22:20:28 发布
网友
如何组合numpy 3d阵列形状(326,25,16)和1d阵列形状(326,) 数组形状(326,25,16)是CNN的输入,数组形状(326,16)是标签
关于您要做的事情,我的最佳嘉宾是复制和调整数组的大小
# same dimensions as your array a=np.random.randn(326) # then you can tile (repeat) your array to have the same shape # of your other array to do element-wise operations or something else b=np.tile(a.reshape(-1,1,1),(1,25,16))
变量b的形状现在是(326, 25, 16)
b
(326, 25, 16)
关于您要做的事情,我的最佳嘉宾是复制和调整数组的大小
变量
b
的形状现在是(326, 25, 16)
相关问题 更多 >
编程相关推荐