haojin2 commented on a change in pull request #17854: [Numpy] FFI: 
random.choice, take and clip
URL: https://github.com/apache/incubator-mxnet/pull/17854#discussion_r393503275
 
 

 ##########
 File path: src/operator/numpy/random/np_choice_op.h
 ##########
 @@ -53,6 +53,19 @@ struct NumpyChoiceParam : public 
dmlc::Parameter<NumpyChoiceParam> {
     DMLC_DECLARE_FIELD(replace).set_default(true);
     DMLC_DECLARE_FIELD(weighted).set_default(false);
   }
+  void SetAttrDict(std::unordered_map<std::string, std::string>* dict) {
+    std::ostringstream a_s, size_s, replace_s, weighted_s;
+    a_s << a;
+    size_s << size;
+    replace_s << replace;
+    weighted_s << weighted;
+    (*dict)["a"] = a_s.str();
+    (*dict)["size"] = size_s.str();
+    (*dict)["replace"] = replace_s.str();
+    (*dict)["weighted"] = weighted_s.str();
+    // We do not set ctx, because ctx has been set in dict instead of 
InitOpParam.
 
 Review comment:
   get rid of this comment, looks like it does not apply to this op.

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


With regards,
Apache Git Services

Reply via email to