Hi,
If you want to get all the values, I’m afraid there is no other way to do it 
If you want to compute a linear combination of these values, then you can do better by using the linearity of the derivative and doing the linear combination on the outputs first then doing a single backward.
Note that you should never use .data in pytorch. You can replace it with .detach() if you want to break the graph. Or nothing if you just want to access the Tensor.