wkcn commented on a change in pull request #17230: Additional fix for vector 
access. 
URL: https://github.com/apache/incubator-mxnet/pull/17230#discussion_r363559546
 
 

 ##########
 File path: 3rdparty/mshadow/mshadow/dot_engine-inl.h
 ##########
 @@ -421,12 +421,9 @@ struct BLASEngine<cpu, double> {
   CBLAS_TRANSPOSE p_transa[GROUP_SIZE] = {cblas_a_trans};
   CBLAS_TRANSPOSE p_transb[GROUP_SIZE] = {cblas_b_trans};
 
-  std::vector<const double*> pp_A;
-  std::vector<const double*> pp_B;
-  std::vector<double*> pp_C;
-  pp_A.reserve(batch_count);
-  pp_B.reserve(batch_count);
-  pp_C.reserve(batch_count);
+  std::vector<const double*> pp_A(batch_count, nullptr);
 
 Review comment:
   Thank you for the fix!
   ~~It will be better to use `std::array`, since `std::vector` will allocate 
the memory, which is greater than `batch_count`.~~

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


With regards,
Apache Git Services

Reply via email to