Hi,
What you give as input to an embedding layer is the index of the element you want to embed and it returns the embedding for this element.
This operation is differentiable wrt the content of the embedding but not the index, thus you cannot give it an index for which you want the gradients (in your code snipet, you set requires_grad=True for a).
If you are just looking for a Linear transformation of the input tensor a, you want to use the nn.Linear 19 layer not nn.Embedding 78