From ae5abb9a01a75c257b1b462a6c95efe71610e955 Mon Sep 17 00:00:00 2001 From: shleym2000 Date: Wed, 16 Dec 2020 07:15:18 -0600 Subject: [PATCH 1/2] Populating position variable before it is used --- opennn/opennn_strings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opennn/opennn_strings.cpp b/opennn/opennn_strings.cpp index 5abf9f031..93b1ecd67 100644 --- a/opennn/opennn_strings.cpp +++ b/opennn/opennn_strings.cpp @@ -136,7 +136,7 @@ void fill_tokens(const string& str, const char& separator, Tensor& to // Find first "non-delimiter" Index index = 0; - Index old_pos; + Index old_pos = 0; Index old_last_pos; while(string::npos != position || string::npos != last_position) From f5f83238d0643d38d068c0d7f78a5b244b355dbd Mon Sep 17 00:00:00 2001 From: Lenny Shleymovich Date: Wed, 16 Dec 2020 11:56:42 -0600 Subject: [PATCH 2/2] Fixing bug in test (cherry picked from commit eb5ad97e0d0dca012813edc24538ddce45ed51c2) --- tests/correlations_test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/correlations_test.cpp b/tests/correlations_test.cpp index 949015e75..2b1c34b30 100644 --- a/tests/correlations_test.cpp +++ b/tests/correlations_test.cpp @@ -483,7 +483,10 @@ void CorrelationsTest::test_exponential_correlation() { y[i] = exp(static_cast(2.5)*x[i] + static_cast(1.4)); } - const ThreadPoolDevice* thread_pool_device = thread_pool_device; + + const int n = omp_get_max_threads(); + NonBlockingThreadPool* non_blocking_thread_pool = new NonBlockingThreadPool(n); + ThreadPoolDevice* thread_pool_device = new ThreadPoolDevice(non_blocking_thread_pool, n); type correlation = exponential_correlation(thread_pool_device,x,y); //@todo(assert_true(correlation > static_cast(0.999999), LOG);)