octoJon commented on code in PR #12284:
URL: https://github.com/apache/tvm/pull/12284#discussion_r937999100


##########
python/tvm/topi/random/kernel.py:
##########
@@ -602,3 +602,57 @@ def normal(gen, mean, scale, out_shape, out_dtype):
     )
 
     return new_gen, random_values
+
+
+def multinomial(gen, probs, num_samples):
+    """Draw samples from a multinomial distribution defined by the input 
tensor.
+
+    Parameters
+    ----------
+    gen : ThreefryKey
+        Generator state. Can be create with :py:func:`tvm.relay.threefry_key`. 
This should not be
+        reused in another function, otherwise random numbers will be repeated.
+
+    probs: Tensor[(input_rows, indices), float]

Review Comment:
   Replacing negative values with zero sounds perfectly reasonable to me, as 
long as it's documented. Thanks!



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to