我正在写一个函数,它接受一个3d矩阵的列表。。在
所以。。列表中的每个元素都有(rows,cols, some_scalar).
的形状。
我想把它改造成4d矩阵。。
所以output = (number_of_elements_in_matrix, rows,cols,some_scalar)
到目前为止
output = np.zeros((len(list_of_matrices), list_of_matrices[0].shape[0], list_of_matrices[0].shape[1],
list_of_matrices[0].shape[2]), dtype=np.uint8)
我怎么知道用这些值填充这个4d张量。。在
^{pr2}$
可以使用^{} 沿第一个轴(axis=0)堆叠,如下-
样本运行-
^{pr2}$相关问题 更多 >
编程相关推荐