code: def gather_tables(
      X,
      col_gather,
      context,
      bos_id,
      eos_id,
      table_position_type,
      max_row_col_embedding,
  ):
      """
      Prepares all the inputs required for initially feeding to one half of the table model.
  
      Args:
          X: Input tokens [batch, seq]
          col_gather: the output of get_gather_indices
          context: context (usually start and end of each row and column) to be gathered and passed to the model.
          bos_id: The BOS token id. (scalar)
          eos_id: _The EOS token id. (scalar)
          table_position_type: One of "row_col" or "all" - the type of position embedding used.
  
      Returns:
          _type_: _description_
      """
      pad_id = max_row_col_embedding - 1
      if table_position_type == "row_col":
          pos_raw = context[:, :, 2:]
          pos_eos = tf.constant([pad_id, pad_id])
      elif table_position_type == "all":
          pos_raw = context
          pos_eos = tf.constant([pad_id, pad_id, pad_id, pad_id])
  
      return {
          **gather_col_vals(
              X, col_gather, eos_id, bos_id, pad_val=1234
          ),
          "scatter_vals": col_gather["values"],
          "positions": gather_col_vals(
              tf.cast(pos_raw, tf.int32),
              col_gather,
              pos_eos,
              pos_eos,
              pad_val=1,
          )["values"],
      }
  
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 6 for calling a global function with example usage: gather_tables(X, col_gather, context, bos_id, eos_id, table_position_type, max_row_col_embedding) and returns: dict