reminisce commented on a change in pull request #7226: Extending the GPU dot 
operator
URL: https://github.com/apache/incubator-mxnet/pull/7226#discussion_r132100222
 
 

 ##########
 File path: src/operator/tensor/dot-inl.h
 ##########
 @@ -484,27 +534,26 @@ inline void DotCsrDnsRspImpl(mshadow::Stream<cpu>* s,
   MSHADOW_TYPE_SWITCH(data_l.type_flag_, DType, {  // data type
     MSHADOW_IDX_TYPE_SWITCH(indptr_l.type_flag_, IType, {  // indptr type
       MSHADOW_IDX_TYPE_SWITCH(col_idx_l.type_flag_, CType, {  // col idx type
-        MSHADOW_IDX_TYPE_SWITCH(row_idx_out.type_flag_, RType, {  // col idx 
type
-          if (kWriteTo == req) {
-            mxnet_op::Kernel<mxnet_op::set_zero, cpu>::Launch(
-                s, data_out.Size(), data_out.dptr<DType>());
-          }
+        MSHADOW_IDX_TYPE_SWITCH(row_idx_out.type_flag_, RType, {  // row idx 
type
+          dim_t num_threads, seg_len;
 
 Review comment:
   It's not recommended to leave variables uninitialized. It's also a good 
practice to minimize the lifetime of a variable. Could you change it to `dim_t 
num_threads = data_out.Size()` and move defining `seg_len` to the line 545?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to