Variableクラスのmatmulメソッドの設定でmatmaulとtypoしている
ftnext opened this issue · comments
nikkie commented
現状
dezero/core.py の 345行目
deep-learning-from-scratch-3/dezero/core.py
Line 345 in a19876c
def setup_variable():
# 省略
Variable.matmaul = dezero.functions.matmul
# 省略
影響
ステップ41の例をVariableインスタンスのメソッドで実行しようとすると、
typoが原因で、matmulメソッドの呼び出しでエラーが発生します。
※masterブランチをcloneし、setup.pyを実行して環境構築しています
>>> import numpy as np
>>> from dezero import Variable
>>> x = Variable(np.random.randn(2, 3))
>>> W = Variable(np.random.randn(3, 4))
>>> # y = dezero.functions.matmul(x, W) 相当のコード
>>> y = x.matmul(W)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Variable' object has no attribute 'matmul'
>>> y = x.matmaul(W)
>>> y.shape
(2, 4)
修正
def setup_variable():
# 省略
Variable.matmul = dezero.functions.matmul
# 省略
Koki Saitoh commented
ありがとうございます。修正しました。
06419d7