Hello,
i tried reading some similar topics on this, but i did not find an answer for me.
My problem is that I want to unfold [B, CH, W, H]  into [B, CH, (WxH)] to feed it into my Transformer, but because I use a 2dPositionalencoding on the first shape, i want to unfold it first to remain the positionalencoding? Does is make sense?
So i found out that i need to unfold it first and then flatten it. And not just flatten WxH and be done, bc that doesnt work for me.
The idea comes from this sentence : “The positional encoding and the feature maps are added
together, and then unfolded into a 1-dimensional array Lx1xD, L  is the length of the array. D is the feature size.”
from this paper: Translating Math Formula Images to LaTeX Sequences Using Deep
Neural Networks with Sequence-level Training
edit:
or do I have to concatenate it to get my results for a transformer?