code: def get_summary_values(inp, gather_vals, input_seq_len):
      bos_mask = tf.reduce_all(
          tf.equal(
              tf.convert_to_tensor([0, input_seq_len + 1]), gather_vals
          ),
          2,
      )
      bos_mask_idxs = tf.range(tf.shape(inp)[1]) * tf.cast(
          bos_mask, tf.int32
      )
      bos_mask_idxs_t = tf.transpose(bos_mask_idxs, [1, 0])
      cumulative_max = tf.scan(
          lambda a, b: tf.maximum(a, b),
          bos_mask_idxs_t,
          initializer=tf.reduce_min(bos_mask_idxs_t, axis=0),
      )
      return tf.gather(
          inp, tf.transpose(cumulative_max, [1, 0]), batch_dims=1
      )
  
file_path: finetune/finetune/base_models/bert/table_utils.py
imports: import tensorflow
  from finetune.base_models.bert.modeling import gelu
label_desc: Use image node_id 9 for calling a global function with example usage: get_summary_values(inp, gather_vals, input_seq_len) and returns: tf