BramVanroy:

outputs.append(v.detach())


I tried with ʻoutputs.append (v.detach ()) ` but the problem is:
TypeError                                 Traceback (most recent call last)
<ipython-input-3-051c943b10b7> in <module>
    180     targets = torch.Tensor(targets)
    181     labels = targets
--> 182     _, predicted = torch.max(outputs, 1)
    183     accuracy = accuracyCalc(predicted, targets)
    184     #labels = labels.tolist()

TypeError: max() received an invalid combination of arguments - got (list, int), but expected one of:
 * (Tensor input)
 * (Tensor input, Tensor other, Tensor out)
 * (Tensor input, int dim, bool keepdim, tuple of Tensors out)