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