File size: 1,550 Bytes
ab854b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
description: Discover detailed information on ImageEncoderViT, PositionEmbeddingRandom, Attention, window_partition, get_rel_pos and more in Ultralytics models encoders documentation.
keywords: Ultralytics, Encoders, Modules, Documentation, ImageEncoderViT, PositionEmbeddingRandom, Attention, window_partition, get_rel_pos
---

# Reference for `ultralytics/models/sam/modules/encoders.py`

!!! note

    Full source code for this file is available at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/encoders.py](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/sam/modules/encoders.py). Help us fix any issues you see by submitting a [Pull Request](https://docs.ultralytics.com/help/contributing/) ๐Ÿ› ๏ธ. Thank you ๐Ÿ™!

---
## ::: ultralytics.models.sam.modules.encoders.ImageEncoderViT
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.PromptEncoder
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.PositionEmbeddingRandom
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.Block
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.Attention
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.PatchEmbed
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.window_partition
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.window_unpartition
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.get_rel_pos
<br><br>

---
## ::: ultralytics.models.sam.modules.encoders.add_decomposed_rel_pos
<br><br>