Unify Transformer coder Constructors (#45515)
Summary:
Fixes #{[45502](https://github.com/pytorch/pytorch/issues/45502)}
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45515
Reviewed By: zhangguanheng66, ZolotukhinM
Differential Revision: D23994644
Pulled By: glaringlee
fbshipit-source-id: b8728e8dfd8857e27246ebb11b17c2d1b48796ca