You should not detach the values if you want to use them for loss calculation later. Other than that, I don’t see any problems einen though I prefer accessing by name rather then accessing by index. But this is just a personal favorite.