Hi,
since my model has a variety of qualitatively different outputs, I would like to do something like this:

Return my predictions from the model in a dictionary with keywoards that indicate the prediction.
Pass that dictionary on to an autograd function that checks whether a keywoard exists and if so, passes it on to a corresponding loss.

Is there any reason this is a bad idea? Is it generally advisable to store cuda() variables such as predictions or losses in lists or dictionaries?
I tried both and didnt get any errors or anything, but that of course does not necessarily mean that it is a good idea…
Thanks for your advice!