Skip to content

Instantly share code, notes, and snippets.

@matthewchung74
Created February 5, 2021 23:45
Show Gist options
  • Save matthewchung74/3ea8b31a8e63ea182b87ceecabfd9cc0 to your computer and use it in GitHub Desktop.
Save matthewchung74/3ea8b31a8e63ea182b87ceecabfd9cc0 to your computer and use it in GitHub Desktop.
from PIL import Image
loader = DataLoader(dataset = train_dataset, batch_size=1, shuffle=False )
first_batch = next(iter(loader))[0]
model = PatchEmbed()
patch_output = model(first_batch)
batch_size, num_patches, embedding = patch_output.shape
num_patches, embedding
(196, 768)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment