code: def scaled_dot_product_attention(q, k, v, mask):
      matmul_qk = tf.matmul(q, k, transpose_b=True)
      dk = tf.cast(tf.shape(k)[-1], tf.float32)
      scaled_attention_logits = matmul_qk / tf.math.sqrt(dk)
      if mask is not None:
          scaled_attention_logits += mask * -1e9
      attention_weights = tf.nn.softmax(
          scaled_attention_logits, axis=-1
      )
      output = tf.matmul(attention_weights, v)
  
      return output, attention_weights
  
imports: import numpy
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: scaled_dot_product_attention(q, k, v, mask) and returns: output,  attention_weights