File size: 1,512 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: Learn about Ultralytics transformer encoder, layer, MLP block, LayerNorm2d and the deformable transformer decoder layer. Expand your understanding of these crucial AI modules.
keywords: Ultralytics, Ultralytics documentation, TransformerEncoderLayer, TransformerLayer, MLPBlock, LayerNorm2d, DeformableTransformerDecoderLayer
---

# Reference for `ultralytics/nn/modules/transformer.py`

!!! note

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

---
## ::: ultralytics.nn.modules.transformer.TransformerEncoderLayer
<br><br>

---
## ::: ultralytics.nn.modules.transformer.AIFI
<br><br>

---
## ::: ultralytics.nn.modules.transformer.TransformerLayer
<br><br>

---
## ::: ultralytics.nn.modules.transformer.TransformerBlock
<br><br>

---
## ::: ultralytics.nn.modules.transformer.MLPBlock
<br><br>

---
## ::: ultralytics.nn.modules.transformer.MLP
<br><br>

---
## ::: ultralytics.nn.modules.transformer.LayerNorm2d
<br><br>

---
## ::: ultralytics.nn.modules.transformer.MSDeformAttn
<br><br>

---
## ::: ultralytics.nn.modules.transformer.DeformableTransformerDecoderLayer
<br><br>

---
## ::: ultralytics.nn.modules.transformer.DeformableTransformerDecoder
<br><br>