by dvnguyen on 10/18/22, 3:45 AM with 1 comments
by pizza on 10/18/22, 4:05 AM
e.g. how to upsample an image 2x
from einops import rearrange, repeat
rearrange(repeat(img, 'h w c -> h w r1 r2 c', r1=2, r2=2), 'h w r1 r2 c -> (h r1) (w r2) c')
there is something that is just so elegant to me about einops. I wish there were even more operations, but it's simplicity is nice too.