Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add multinomial op #27219

Merged
merged 13 commits into from
Sep 29, 2020
Merged

Conversation

pangyoki
Copy link
Contributor

@pangyoki pangyoki commented Sep 9, 2020

PR types

New features

PR changes

OPs

Describe

  • add multinomial op (C++ op)

  • add paddle.multinomial(x, num_samples=1, replacement=False, name=None) (python API)

    • x(Tensor): A tensor with probabilities for generating the random number.
    • num_samples(int, optional): Number of samples, default is 1.
    • replacement(bool, optional): Whether it is a replaceable sample, default is False. If replacement is False, it's not a replaceable sample. Every category can be used only once.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Sep 9, 2020

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


import paddle

paddle.disable_static()
Copy link
Contributor

@zhiqiu zhiqiu Sep 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be removed, you can refine it in the next PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, refer to PR #27736

Copy link
Contributor

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhiqiu zhiqiu merged commit 7cd2c13 into PaddlePaddle:develop Sep 29, 2020
@pangyoki pangyoki mentioned this pull request Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants