Simplify the encoder code
ShengYun-Peng opened this issue · 0 comments
ShengYun-Peng commented
Thanks for the clean implementation! I guess replacing the ModuleList with Sequential has the same effect, but you can remove the for loop in the following forward function.
transformer-from-scratch/src/encoder.py
Line 43 in 86076d2