That’s one possibility. I think a better implementation may take advantage of using hooks. I think you can keep the original and use register_forward_hook during the forward phase to get the embedding.