You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/12 20:04:50 UTC

[GitHub] azai91 commented on a change in pull request #11129: [MXNET-497]Test kAddTo request for mkldnn operators

azai91 commented on a change in pull request #11129: [MXNET-497]Test kAddTo request for mkldnn operators
URL: https://github.com/apache/incubator-mxnet/pull/11129#discussion_r194870537
 
 

 ##########
 File path: tests/cpp/operator/mkldnn.cc
 ##########
 @@ -571,9 +613,8 @@ void VerifyActResult(const std::vector<NDArray *> &in_arrs, const NDArray &arr)
   mshadow::default_real_t *d1 = static_cast<mshadow::default_real_t*>(blob1.dptr_);
   mshadow::default_real_t *d2 = static_cast<mshadow::default_real_t*>(blob2.dptr_);
   EXPECT_EQ(tmp1.shape().Size(), tmp2.shape().Size());
-  for (size_t i = 0; i < tmp1.shape().Size(); i++) {
-    EXPECT_EQ(d1[i], std::fmax(d2[i], 0));
-  }
+  for (size_t i = 0; i < tmp1.shape().Size(); i++)
+    ASSERT_EQ(d2[i], std::fmax(d1[i], 0));
 
 Review comment:
   ASSERT_EQ is from gtest? I am using ASSERT_EQ over EXPECT_EQ here cause I want the test to fail as soon as one comparison fails (else we get an error message from every incorrect element in the vector).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services