Views
No views yet
1import torch
2from hub.networks.adaperceiver_distill import DistillAdaPerceiver
3
4model = DistillAdaPerceiver.from_pretrained("pjajal/adaperceiver-v1")
5
6# forward(
7# x: input image tensor (B, C, H, W)
8# num_tokens: number of latent tokens to process (optional)
9# mat_dim: embedding dimension (optional)
10# depth: early-exit depth (optional)
11# token_grans: block-mask granularities (optional)
12# )
13out = model(
14 torch.randn(1, 3, 224, 224),
15 num_tokens=256,
16 mat_dim=128,
17 depth=12,
18)
19
20print(out.logits.shape, out.features.shape)1@article{jajal2025adaperceiver,
2 title={AdaPerceiver: Transformers with Adaptive Width, Depth, and Tokens},
3 author={Jajal, Purvish and Eliopoulos, Nick John and Chou, Benjamin Shiue-Hal and Thiruvathukal, George K and Lu, Yung-Hsiang and Davis, James C},
4 journal={arXiv preprint arXiv:2511.18105},
5 year={2025}
6}