jwfromm commented on code in PR #12284:
URL: https://github.com/apache/tvm/pull/12284#discussion_r936900244
##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -3386,6 +3386,19 @@ def trilu(self, inputs, input_types, mode):
upper = True if mode == "triu" else False
return _op.trilu(data, k, upper)
+ def multinomial(self, inputs, input_types):
+ probs = inputs[0]
+ num_samples = inputs[1]
+ replacement = inputs[2] if inputs[2] else True
+ assert not (
+ replacement is False and num_samples > 1
+ ), "Multinomial without replacement is not yet supported."
+ seed = np.random.randint(1e6)
Review Comment:
Yeah thats a good point, we'd have to use a global dictionary or something
for that. I'll add a note. For now, this approach matches how we handle other
rng importer functions.
--
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]