Let me show you the same code using einops:
from einops import repeat, rearrange

q_ = repeat(q, 'b sent channel -> b (sent sent2) channel', sent2=sent_len)
k_ = repeat(q, 'b sent channel -> b (sent2 sent) channel', sent2=sent_len)
concat_vecs = rearrange([q_, k_], 'qk b sentbysent channel -> b sentbysent (qk channel)')