xidulu edited a comment on issue #19073: URL: https://github.com/apache/incubator-mxnet/issues/19073#issuecomment-724673978
In short, you could add a check after the while loop (before https://github.com/apache/incubator-mxnet/blob/9d440868603ad26b702e12ddd2587e5c4b56e42b/src/operator/random/sample_multinomial_op.h#L141) to see if left == K (which is not in [0, K) ), if that happens, you should manually call `left--` before so that the result still lies in [0, K). I would love to open a PR for that but unfortunately I currently do not have any device capable of to build MXNet from source. ---------------------------------------------------------------- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
