A ViT treats an image as a sequence of patch tokens. Each patch is flattened into a vector before a linear projection, so the layout of the patches has to be set up carefully.
Implement patchify(img, p), which splits the image into flattened non-overlapping patches.
Reshape to a grid of blocks, move the grid axes to the front, then flatten each block.
No results yet
Run your code to check it against the examples, or submit to run every test.