From 34963f08ad948fdbd6d390cc7cb93f933f61cae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=9D=82=E6=98=B4?= Date: Mon, 14 Oct 2024 22:10:11 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/homework2/main.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/homework2/main.py diff --git a/test/homework2/main.py b/test/homework2/main.py new file mode 100644 index 0000000..450cd98 --- /dev/null +++ b/test/homework2/main.py @@ -0,0 +1,14 @@ +import numpy as np + +a = np.arange(2 * 3 * 4).reshape(2, 3, 4) + +b = np.arange(12).reshape(2, 6) + +c = a + b.reshape(2, 3, 4) + +c_flattened = c.flatten(copy=True) + +print("a\n", a) +print("b\n", b) +print("c\n", c) +print("c_flattened\n", c_flattened)