code: def _calc_relevancy_matrix(reps_lt, reps_rt):
      reps_lt = tf.expand_dims(reps_lt, 1)  # [b, 1, len_lt, d]
      reps_rt = tf.expand_dims(reps_rt, 2)  # [b, len_rt, 1, d]
      relevancy_matrix = _cosine_distance(reps_lt, reps_rt)
      # => [b, len_rt, len_lt, d]
      return relevancy_matrix
  
imports: import tensorflow
  from keras import backend
  from keras.engine import Layer
  from matchzoo.contrib.layers.attention_layer import AttentionLayer
label_desc: Use image node_id 6 for calling a global function with example usage: _calc_relevancy_matrix(reps_lt, reps_rt) and returns: relevancy_matrix