There isn’t any symbolic code, the functions call various C++ functions for the embeddings, there is the CPU backward for dense matrices 4, next to it is a version for sparse matrices on CPU. The CUDA code is a bit more elaborate 4.
I’m not sure the chances are good to find an obvious reason for the discrepancy - essentially the backward would seem to permute summing addition (for multiple occurrences of the same grad) with multiplying some parts with 0.
Best regards
Thomas