code: def dynamic_conv_on_ra_out(ra_out, weights):
      """
      ra_out: batch, length, ra_size, channels
      weights: atch, Time, FilterWidth, Heads
      """
      batch, seq, ra_depth, n_channels = shape_list(ra_out)
      _, _, kernel_width, n_heads = shape_list(weights)
      assert n_channels % n_heads == 0
      assert ra_depth == kernel_width
      h = n_channels // n_heads
      unfolded = tf.reshape(ra_out, [batch, seq, ra_depth, n_heads, h])
      weights_expanded = tf.expand_dims(weights, 4)
      return tf.reshape(
          tf.reduce_sum(weights_expanded * unfolded, 2),
          [batch, seq, n_channels],
      )
  
file_path: finetune/finetune/custom_ops/indico_tf_ops/python/dynamic_conv.py
imports: import os
  import math
  import numpy
  import tensorflow
  from finetune.util.shapes import shape_list
  from finetune.custom_ops.indico_tf_ops.python import indico_ops
label_desc: Use image node_id 4 for calling a global function with example usage: dynamic_conv_on_ra_out(ra_out, weights) and returns: tf