x = features[None, :, :]
// For dense matrix, remove batch dimension
A_mat = Lambda(lambda A: K.squeeze(A, 0))(A_t)
out = GraphConvolution(2)([x_t, A_mat])
model = keras.Model(inputs=[x_t, A_t], outputs=out)
preds = model.predict([x, adj], batch_size=1)
After Change
// batch dimension > 1 should work with a dense matrix
x_t = Input(batch_shape=(10,) + features.shape)
A_t = Input(batch_shape=(10, 3, 3))
input_data = [np.broadcast_to(x, x_t.shape), np.broadcast_to(adj, A_t.shape)]
out = GraphConvolution(2)([x_t, A_t])
model = keras.Model(inputs=[x_t, A_t], outputs=out)
preds = model.predict(input_data, batch_size=10)
assert preds.shape == (10, 3, 2)
for i in range(1, 10):
// every batch element had the same input data, so the predictions should all be identical
np.testing.assert_array_equal(preds[i, ...], preds[0, ...])