Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/pytorch/tutorials
/ transformer_building_blocks.py
File
transformer_building_blocks.py
intermediate_source/transformer_building_blocks.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
""
"
2
.. meta::
3
:description: Learn how to optimize transformer models by replacing nn.Transformer
with
Nested Tensors and torch.compile()
for
significant performance gains in PyTorch.
4
Callers
nothing calls this directly
Calls
8
InputProjection
Class · 0.85
PackedInputProjection
Class · 0.85
SwiGLUFFN
Class · 0.85
PackedSwiGLUFFN
Class · 0.85
gen_batch
Function · 0.70
MultiHeadAttention
Class · 0.70
benchmark
Function · 0.70
backward
Method · 0.45
Tested by
no test coverage detected