第二次作业来咯

This commit is contained in:
2024-10-18 22:15:30 +08:00
parent 34963f08ad
commit 74954ee77e
+8 -8
View File
@@ -1,14 +1,14 @@
import numpy as np
a = np.arange(2 * 3 * 4).reshape(2, 3, 4)
a = np.arange(24).reshape(2, 3, 4)
b = np.arange(12).reshape(2, 6)
b = np.arange(12).reshape(3, 4)
c = a + b.reshape(2, 3, 4)
c = a + b
c_flattened = c.flatten(copy=True)
flattened_c = c.flatten().copy()
print("a\n", a)
print("b\n", b)
print("c\n", c)
print("c_flattened\n", c_flattened)
print("矩阵 a\n", a)
print("\n矩阵 b\n", b)
print("\n矩阵 ca + b):\n", c)
print("\n展平后的矩阵 c\n", flattened_c)