piiswrong commented on a change in pull request #10970: [MXNET-424] dtype 
option for multinomial
URL: https://github.com/apache/incubator-mxnet/pull/10970#discussion_r189047791
 
 

 ##########
 File path: src/operator/random/sample_multinomial_op.h
 ##########
 @@ -155,9 +158,11 @@ void SampleMultinomialForward(const nnvm::NodeAttrs& 
attrs,
     Tensor<xpu, 1, float> uniform =
       ctx.requested[1].get_space_typed<xpu, 1, float>(Shape1(N*M), s);
     prnd->SampleUniform(&uniform, 0, 1);
-    Kernel<SampleMultinomialKernel, xpu>::Launch(
-      s, N, K, M, inputs[0].dptr<DType>(), uniform.dptr_, 
outputs[0].dptr<int>(),
-      param.get_prob ? outputs[1].dptr<DType>() : nullptr);
+    MSHADOW_TYPE_SWITCH(outputs[0].type_flag_, IType, {
 
 Review comment:
   This kind of 2 layer switches is very slow to compile. Why do we need type 
support for output?

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