---
description: Explore the detailed implementation of TinyViT architecture including Conv2d_BN, PatchEmbed, MBConv, and more in Ultralytics.
keywords: Ultralytics, TinyViT, Conv2d_BN, PatchEmbed, MBConv, Attention, PyTorch, YOLO, Deep Learning
---
# Reference for `ultralytics/models/sam/modules/tiny_encoder.py`
!!! Note
This file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/tiny_encoder.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/tiny_encoder.py). If you spot a problem please help fix it by [contributing](https://docs.ultralytics.com/help/contributing/) a [Pull Request](https://github.com/ultralytics/ultralytics/edit/main/ultralytics/models/sam/modules/tiny_encoder.py) 🛠️. Thank you 🙏!
## ::: ultralytics.models.sam.modules.tiny_encoder.Conv2d_BN
## ::: ultralytics.models.sam.modules.tiny_encoder.PatchEmbed
## ::: ultralytics.models.sam.modules.tiny_encoder.MBConv
## ::: ultralytics.models.sam.modules.tiny_encoder.PatchMerging
## ::: ultralytics.models.sam.modules.tiny_encoder.ConvLayer
## ::: ultralytics.models.sam.modules.tiny_encoder.Mlp
## ::: ultralytics.models.sam.modules.tiny_encoder.Attention
## ::: ultralytics.models.sam.modules.tiny_encoder.TinyViTBlock
## ::: ultralytics.models.sam.modules.tiny_encoder.BasicLayer
## ::: ultralytics.models.sam.modules.tiny_encoder.LayerNorm2d
## ::: ultralytics.models.sam.modules.tiny_encoder.TinyViT