My bad, I misunderstood.
So I’m not sure of the optimal way of doing it.
But maybe doing something like this might help you:
segments_sizes = (5, 6)
pooled_segs = []
for seg in torch.split(sentence_embedding, segments_sizes, dim=0):
    pooled_segs.append(pooling_op(seg))
pooled_sentence_embedding = torch.cat(pooled_segs, dim=0)