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 2017/12/11 23:29:28 UTC

[GitHub] reminisce commented on a change in pull request #9014: square sum gpu impl

reminisce commented on a change in pull request #9014: square sum gpu impl
URL: https://github.com/apache/incubator-mxnet/pull/9014#discussion_r156232351
 
 

 ##########
 File path: src/operator/tensor/square_sum-inl.h
 ##########
 @@ -359,6 +353,24 @@ void SquareSumRspImpl(const nnvm::NodeAttrs& attrs,
   }
 }
 
+/*!
+ * \brief check the indices of ograd and input are the same.
+ */
+struct CheckSameIdxKernel {
+  template<typename IType>
+  MSHADOW_XINLINE static void Map(int i, IType* ograd_idx, IType* in_idx, int32_t* is_same) {
+    if (ograd_idx[i] != in_idx[i]){
+      *is_same = 1;
 
 Review comment:
   The name of `is_same` looks like a `is_different` after checking the logic, or should it be assigned with `0` rather than `1` if `ograd_idx[i] != in_idx[i]`?

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