Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Point to examples in component swap tutorial #3703

Merged
merged 2 commits into from
Jun 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/source/tutorial_swap_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ layer = TransformerLayer.with_components(ffn=NewCustomFFN)(opt, ...)

As long as `NewCustomFFN` has the same `__init__` and `forward` method signatures as `TransformerFFN`, everything should just work.

For examples, see:
- `parlai/agents/examples/transformer_variant.py`
- `projects/params_vs_compute/hash_ladder/hash_ladder.py`

## Composability

Since the swapping happens before instantiation, decorated components can be transparently composed. For example:
Expand Down