Skip to content
Discussion options

You must be logged in to vote

Hi. Your matrix multiplication shape is: (dim, patch_dim) @ (patch_num, patch_dim).
use
new_img = rearrange(img, 'b c (h p1) (w p2) -> b (p1 p2 c) (h w)', p1 = patch_height, p2 = patch_width)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@conceptofmind
Comment options

@YouJiacheng
Comment options

@YouJiacheng
Comment options

@conceptofmind
Comment options

Answer selected by conceptofmind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants