Skip to content

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.

@pangyoki pangyoki force-pushed the add-multinomial-op-branch branch from 6639804 to c66eec7 Compare September 25, 2020 08:46
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