我有3个矩阵
A=[[[1,2,3]]]
B=[[[3,4,5]]]
和
C=[[[4,5,6]]]
我想添加这 3 个矩阵。预期结果在哪里
A+B+C = [[[8,11,14]]]
请帮我解决这个问题。
可以这样做:
A=[[[1,2,3]]]
B=[[[3,4,5]]]
C=[[[4,5,6]]]
print [[map(sum, zip(A[0][0], B[0][0], C[0][0]))]]
>>> import numpy as np
>>> A = np.array([[[1,2,3]]])
>>> B = np.array([[[3,4,5]]])
>>> C = np.array([[[4,5,6]]])
>>> D = A+B+C
>>> D
array([[[ 8, 11, 14]]])