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/08/02 21:29:11 UTC

[GitHub] larroy commented on a change in pull request #11778: [MXNET-483] C++ tests for mkldnn convolution operator

larroy commented on a change in pull request #11778: [MXNET-483] C++ tests for mkldnn convolution operator
URL: https://github.com/apache/incubator-mxnet/pull/11778#discussion_r207380834
 
 

 ##########
 File path: tests/cpp/operator/mkldnn.cc
 ##########
 @@ -557,33 +614,34 @@ void PrintVerifyMsg(const NDArrayAttrs &arr1, const NDArrayAttrs &arr2) {
  *
  *  num_inputs / dim arguments used to scale shape (used for concat backwards to enlarge input shapes)
  */
-std::vector<NDArrayAttrs> GetTestInputArrays(bool rand = false, int num_inputs = 1, int dim = 0) {
+std::vector<NDArrayAttrs> GetTestInputArrays(bool rand = false,
+                                             std::vector<float> scale = {1}) {
   TestArrayShapes tas = GetTestArrayShapes();
   std::vector<nnvm::TShape> shapes = tas.shapes;
   std::vector<mkldnn::memory::primitive_desc> pds = tas.pds;
 
   std::vector<NDArrayAttrs> in_arrs;
   std::string desc;
 
-  int slice_amount = 1;
-  if (dim == 0)
-    slice_amount = num_inputs;
+  int slice_amount = scale[0];
   for (auto shape : shapes) {
-    if (dim >= shape.ndim())
+    if (scale.size() > shape.ndim())
       continue;
-    shape[dim] = shape[dim] * num_inputs;
+
+    for (int dim = 0; dim < scale.size(); dim++)
 
 Review comment:
   right type is size_t, ++dim (pre-increment) is standard C++ idiom

----------------------------------------------------------------
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