Here’s the sample inputs.
1.00000e-02 *
  6.5441
  1.6199
  1.6199
  1.6199
  0.9627
  0.9627
  0.9351
  1.6199
  1.6199
  1.6199
  1.6199
  2.8784
  0.9627
  0.9627
  4.0087
  0.9351
[torch.DoubleTensor of size (16,)]


1.00000e-02 *
  0.9627
  1.6199
  4.0087
  1.6199
  4.7620
  4.7620
  2.3129
  1.6199
  0.1195
  1.6199
  1.6199
  1.4622
  4.7620
  8.2307
  1.6199
  2.3129
[torch.DoubleTensor of size (16,)]


-1
-1
 1
-1
 1
 1
 1
 1
 1
-1
-1
-1
 1
 1
-1
 1
[torch.DoubleTensor of size (16,)]

The code does not fail on some specific inputs. It fails on all of them, so I’m not sure whether it is the input that is causing the problem.