diff options
author | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2015-09-23 13:38:29 -0700 |
---|---|---|
committer | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2015-09-23 20:24:10 -0700 |
commit | 74e174537418b6a3c0c8708e444edf45ab491e94 (patch) | |
tree | e93d65805c9f532433a6b07d0827885df2992329 | |
parent | d425e59d7494e84be63ad570a149194edce73935 (diff) | |
download | caffeonacl-74e174537418b6a3c0c8708e444edf45ab491e94.tar.gz caffeonacl-74e174537418b6a3c0c8708e444edf45ab491e94.tar.bz2 caffeonacl-74e174537418b6a3c0c8708e444edf45ab491e94.zip |
[test] TestReshape: check small then large
checking large then small can mask failure since the smaller shape
memory will fit within the larger shape.
-rw-r--r-- | src/caffe/test/test_net.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/caffe/test/test_net.cpp b/src/caffe/test/test_net.cpp index 12998d89..ec01053c 100644 --- a/src/caffe/test/test_net.cpp +++ b/src/caffe/test/test_net.cpp @@ -2269,8 +2269,10 @@ TYPED_TEST(NetTest, TestReshape) { FillerParameter filler_param; filler_param.set_std(1); GaussianFiller<Dtype> filler(filler_param); - Blob<Dtype> blob1(4, 3, 9, 11); - Blob<Dtype> blob2(2, 3, 12, 10); + // Check smaller shape first as larger first could hide realloc failures. + Blob<Dtype> blob1(2, 3, 12, 10); + Blob<Dtype> blob2(4, 3, 9, 11); + ASSERT_LT(blob1.count(), blob2.count()); filler.Fill(&blob1); filler.Fill(&blob2); |