You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HybridEncoder position embedding is scrambled for non-square inputs #362
Hi. There is a bug with swapped H and W in position embeddings, so non-square inputs get scrambled positions:
build_2d_sincos_position_embedding(w, h) builds its grid as meshgrid(grid_w, grid_h, indexing="ij") (shape (w, h)), but the encoder flattens tokens row-major ((h, w)). For square maps this is only a transpose. For non-square maps the positions are wrong: on a 14×28 map, the token at row 0, column 20 is given row 1, column 6.
Activity