Merge heads
×Concatenate the heads at each position.
- in
- [B batch, 64 heads, T positions, 256 value]
- out
- [B batch, T positions, 16384 heads × value]
Explanation
Heads are concatenated in order: head fills features .
Sources
In codeattn_output.reshape(batch_size, seq_length, -1)
Direct evidence
Head outputs are flattened and projected back to the model width.
modeling_glm_moe_dsa.py 449–451 ↗ · huggingface/transformers @ c4c4605f9618
Excerpt
attn_output = attn_output.reshape(batch_size, seq_length, -1).contiguous()
attn_output = self.o_proj(attn_output)
return attn_output, attn_weights, topk_indices