# Executorch - Encoder/Decoder models?

**URL:** <https://discuss.pytorch.org/t/executorch-encoder-decoder-models/213305>\
**Category:** ExecuTorch\
**Created:** [November 22, 2024, 11:38am UTC](https://discuss.pytorch.org/t/executorch-encoder-decoder-models/213305 "2024-11-22T11:38:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cptspacemanspiff](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/cptspacemanspiff/32/74098_2.png) [@cptspacemanspiff](https://discuss.pytorch.org/u/cptspacemanspiff)\
**Post date:** [November 22, 2024, 11:38am UTC](https://discuss.pytorch.org/t/executorch-encoder-decoder-models/213305/1 "2024-11-22T11:38:56Z")

</div>

Not sure if this is the right place, but I am trying to understand what people would recommend for implementing an encoder-decoder architecture in executorch. Would you implement them as 2 separate models and call the encoder once in the c++ runner, then pass the results as an input to the decoder (followed by the same type of decoder iteration that decoder only models do?)

Or is there a better way?

Thanks

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [November 22, 2024, 11:11pm UTC](https://discuss.pytorch.org/t/executorch-encoder-decoder-models/213305/2 "2024-11-22T23:11:43Z")

</div>

Would the alternative be to wrap both modules into a single parent module and execute them together? If so, I would not expect to see a difference between these approaches and would claim it comes down to your coding style and if you want to use the intermediates in another way.
