code: def attention(self, query, key, value):
      assert (
          query.shape.ndims == key.shape.ndims == value.shape.ndims >= 2
      )
      assert query.shape[-1] == key.shape[-1]
      assert key.shape[-2] == value.shape[-2]
  
      score = tf.matmul(query, tf.transpose(key, [0, 1, 3, 2]))
      score = score / tf.sqrt(
          tf.cast(tf.shape(key)[-1], dtype=tf.float32)
      )
      score = restricted_softmax(score, dim=-1)
      score = tf.matmul(score, value)
      return score
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  import tf_euler
  from tf_euler.python.convolution import conv
  from tf_euler.python.euler_ops import mp_ops
label_desc: Use image node_id 3 for calling the DNAConv obj's underlying member method code with example usage: obj.attention(query, key, value) and returns: score