diff --git a/src/mlpack/tests/ann/layer/parametric_relu.cpp b/src/mlpack/tests/ann/layer/parametric_relu.cpp index 35d8dd037b..c300050087 100644 --- a/src/mlpack/tests/ann/layer/parametric_relu.cpp +++ b/src/mlpack/tests/ann/layer/parametric_relu.cpp @@ -117,7 +117,7 @@ TEST_CASE("PReLUIntegrationTest", "[ANNLayerTest]") model.Add(3); model.Add(0.01); model.Add(1); - model.InputDimensions() = std::vector({trainData.n_rows}); + // Sometimes the model may not optimize correctly, so we allow a few trials. bool success = false; for (size_t trial = 0; trial < 3; ++trial)