在参考别人的tensorflow/keras代码时常遇到K.dot的使用,pytorch中也有torch.dot但是两个函数的含义并不相同
keras.backend.dot(x, y)
将 2 个张量(和/或变量)相乘并返回一个张量。
官网文档的例子:
# dot product between tensors
>>> x = K.placeholder(shape=(2, 3))
>>> y = K.placeholder(shape=(3, 4))
>>> xy = K.dot(x, y)
>>> xy
<tf.Tensor 'MatMul_9:0' shape=(2, 4) dtype