Я пытаюсь сделать matmul внутри графика keras и получил AttributeError: 'NoneType' object has no attribute '_inbound_nodes' error
при компиляции модели
from keras import backend as K
from keras.layers import Input, Dense, Reshape
mainInput = Input(shape=(10*10,))
x = Dense(10*10, activation='relu')(x)
x1 = Reshape((10, 10))(x)
x2 = Dense( 2 * 10, activation='relu')(x)
x2 = Reshape((2, 10))(x2)
added = K.dot(x2, x1)
out = Dense(2 * 10, activation='linear')(added)
optimizer = optimizers.adam(lr=0.001)
model = Model(inputs=[mainInput], outputs=[out])
model.compile(loss='mse', metrics = ['mae'], optimizer=optimizer)
В чем причина этой ошибки?