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 2019/09/30 23:18:03 UTC

[GitHub] [incubator-mxnet] wkcn commented on a change in pull request #15921: [WIP] dynamic custom operator support

wkcn commented on a change in pull request #15921: [WIP] dynamic custom operator support
URL: https://github.com/apache/incubator-mxnet/pull/15921#discussion_r329825089
 
 

 ##########
 File path: example/lib_ops/gemm_lib.cc
 ##########
 @@ -123,13 +114,17 @@ MXReturnValue backward(std::map<std::string, std::string> attrs,
 
   std::cout << "n: " << n << " k: " << k << " m: " << m << std::endl;
 
-  float At[n*k], Bt[k*m];
+  float *At = new float[n*k];
+  float *Bt = new float[k*m];
+
   transpose(A, At, n, k);
   transpose(B, Bt, k, m);
 
   gemm(dC, Bt, dA, n, k, m);
   gemm(At, dC, dB, n, k, m);
 
+  free(At);
 
 Review comment:
   delete []At;
   delete []Bt;
   
   new and delete are matching, and malloc and free are matching.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services