title: How to calculate Cosine similarity and Euclidean distance between two tensors in TF2.0?
body: <p>I have two tensors (OQ, OA) with shapes as below at the end of last layers in my model.</p>
  
  <p>OQ shape: (1, 600)</p>
  
  <p>OA shape: (1, 600)</p>
  
  <p>These tensors are of type 'tensorflow.python.framework.ops.Tensor'</p>
  
  <ol>
  <li>How can we calculate cosine similarity and Euclidean distance for these tensors in Tensorflow 2.0?</li>
  <li>Do we get a tensor again or a single score value between [0,1]? Please help.
  <a href="https://i.stack.imgur.com/7ugX8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7ugX8.png" alt="enter image description here"></a></li>
  </ol>
  
  <p>I tried this but not able to view the score.</p>
  
  <pre><code>score_cosine = tf.losses.cosine_similarity(tf.nn.l2_normalize(OQ, 0), tf.nn.l2_normalize(OA, 0))
  print (score_cosine)
  </code></pre>
  
  <p>Output: Tensor("Neg_1:0", shape=(1,), dtype=float32)</p>