Skip to content

Commit

Permalink
Point to examples in component swap tutorial (facebookresearch#3703)
Browse files Browse the repository at this point in the history
* point to examples in component swap tutorial

* add hash_ladder example
  • Loading branch information
spencerp authored Jun 14, 2021
1 parent 4014ae9 commit 398c808
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 398c808

Please sign in to comment.