回答編集履歴
2
コードの修正
test
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
```python
|
4
4
|
|
5
|
-
|
5
|
+
a = np.empty((2,2,2,3))
|
6
6
|
|
7
|
-
|
7
|
+
b = np.empty((2,2,3,2))
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
np.tensordot(a,b, axes=0).shape
|
12
12
|
|
13
|
-
|
13
|
+
(2, 2, 2, 3, 2, 2, 3, 2)
|
14
14
|
|
15
15
|
```
|
1
使い方の追記
test
CHANGED
@@ -1 +1,15 @@
|
|
1
1
|
numpy.tensordot() を使ってください。
|
2
|
+
|
3
|
+
```python
|
4
|
+
|
5
|
+
In []: a = np.empty((2,2,2,3))
|
6
|
+
|
7
|
+
...: b = np.empty((2,2,3,2))
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
In []: np.tensordot(a,b, axes=0).shape
|
12
|
+
|
13
|
+
Out[]: (2, 2, 2, 3, 2, 2, 3, 2)
|
14
|
+
|
15
|
+
```
|