Fix flakiness issues in c++ nn gradient tests.
Changes: - Tolerance was too strict for L2LossGrad. Reducing tolerance to 1e-3 resolved the issue. - Numeric gradient computation perturbation changed the value of the max value in MaxPool and MaxPoolV2 if two values were too close together (thanks Chad!). Resolved this by ensuring that the tests only compute one window on the entire input. Then I ensure that the max value of the random value is max by 1e-2, so that a perturbation can't replace it. - Also some minor formatting fixes in nn_grad.cc PiperOrigin-RevId: 169732110
Loading
Please sign in to comment