答案 0 :(得分:0)
一个例子:
import keras.backend as K
a = K.constant([[1,2,3],[1,2,3]])
print(a.shape)
b = K.constant([[1],[2]])
print(b.shape)
result = K.dot(K.transpose(a),b)
print(result.shape)
print(K.eval(result))
# print
(2, 3)
(2, 1)
(3, 1)
[[3.]
[6.]
[9.]]