Ich versuche, eine Funktion zu schreiben, die in einer Liste von 3D-Matrices nimmt ..Konvertieren eine Liste der 3D-Matrix in 4D Matrix
so .. jedes Element in der Liste hat Form (rows,cols, some_scalar).
. ich es in 4d Matrix neu zu gestalten versuchen .. so output = (number_of_elements_in_matrix, rows,cols,some_scalar)
bisher habe ich ist
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)
Wie weiß ich, diesen Ausgang 4d Tensor mit den Werten füllen ..
def reshape_matrix(list_of_matrices):
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)
return output
@Divakar: ja .. das hat seinen Zweck erfüllt .., wenn Sie es als Antwort schreiben wollen? – Fraz