How to use a custom embedding layer as input in get_encoder function

I’m trying to tweak inputs from BART model. I’m trying to use output from a different embedding layer and use that as input for my model to get encoder outputs.