code: def cascaded_pool(
      value, kernel_size, dim=1, pool_len=None, use_fused_kernel=True
  ):
      shape = shape_list(value)
      full_pool_len = pool_len or shape[dim]
      ra = recursive_agg
  
      aggregated = ra(value, kernel_size, full_pool_len)
      num_pooling_ops = shape_list(aggregated)[2]
  
      ws = normal_1d_conv_block(
          value,
          1,
          "pool_w",
          value.dtype == tf.float16,
          output_dim=shape[-1],
      )
      wt = normal_1d_conv_block(
          value,
          1,
          "pool_t",
          value.dtype == tf.float16,
          output_dim=num_pooling_ops,
      )
      weights = tf.nn.softmax(wt)
      wt = tf.expand_dims(weights, -1)
  
      weighted_over_time = tf.reduce_mean(
          input_tensor=aggregated * wt, axis=2
      ) * tf.nn.sigmoid(ws)
  
      return weighted_over_time
  
file_path: finetune/finetune/base_models/oscar/featurizer.py
imports: import tensorflow
  from finetune.base_models.gpt.featurizer import dropout, embed, split_heads, merge_heads
  from finetune.util.shapes import shape_list, lengths_from_eos_idx
  from finetune.custom_ops import recursive_agg
  from finetune.base_models.gpt.featurizer import get_pos_values
  from finetune.optimizers.recompute_grads import recompute_grad
  import functools
label_desc: Use image node_id 5 for calling a global function with example usage: cascaded_pool(value, kernel_size, dim, pool_len, use_fused_kernel) and returns: weighted_over_time