I was wondering if there is an easy way to calculate the dot product of two vectors (i.e. 1-d tensors) and return a scalar value in tensorflow.
Given two vectors X=(
Let us assume that you have two column vectors
u = tf.constant([[2.], [3.]]) v = tf.constant([[5.], [7.]])
If you want a 1x1 matrix you can use
tf.einsum('ij,ik->jk',x,y)
If you are interested in a scalar you can use
tf.einsum('ij,ik->',x,y)