Hi Alban
Actually I have calculated the (data_phrases) from (data_words) but this was outside the training loop.  So what I was intending to do is to pass to the optimizer the same batch of (data_words) that produced (data_phrases). So it is indirect relationship.  so that the optimizer updates the “data_phrases” (directly used to calculate the loss) and “data_words” (indirectly related).
The point I passed the tensor (data_words) to the training loop while not being concerned with the softmax model is that I needed to pass it to the same optimiser, therefore I made it this way.
still no sense?
I see your point, but then why if i only pass to the optimizer the tensor (data_words) self.optimizer.add_param_group({“params”: data_words}), I find that the gradients are calculated successfully (and not None)?