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

move distribution.py into distribution package for better scalability #38047

Merged
merged 1 commit into from
Dec 23, 2021

Conversation

cxxly
Copy link
Contributor

@cxxly cxxly commented Dec 10, 2021

PR types

Others

PR changes

Others

Describe

We plan to develop probability distribution package, which will add 25 New APIs and corresponding operators. Currently, paddle organizes all distributions in one file python/paddle/distribution.py. It's difficultly to extend this file for adding New API. So we make new a distribution package python/paddle/distribution, move distribution.py into it, and split it into more simple files.

This modification don't change the path of current api,so users and developer are not affected.
For example, the follow sample code can normally run before and after this modification.

import paddle
from paddle.distribution import Normal

# Define a single scalar Normal distribution.
dist = Normal(loc=0., scale=3.)
# Define a batch of two scalar valued Normals.
# The first has mean 1 and standard deviation 11, the second 2 and 22.
dist = Normal(loc=[1., 2.], scale=[11., 22.])
# Get 3 samples, returning a 3 x 2 tensor.
print(dist.sample([3]))

@paddle-bot-old
Copy link

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

@cxxly cxxly force-pushed the move-distribution-file branch 2 times, most recently from 9636730 to 7dbc5ed Compare December 13, 2021 02:29
@cxxly cxxly force-pushed the move-distribution-file branch from 7dbc5ed to 1be4a3f Compare December 13, 2021 10:12
@cxxly cxxly force-pushed the move-distribution-file branch from 1be4a3f to 08124e9 Compare December 14, 2021 07:07
@cxxly cxxly force-pushed the move-distribution-file branch from 08124e9 to b367294 Compare December 15, 2021 07:51
@cxxly cxxly force-pushed the move-distribution-file branch from b367294 to a6efaf2 Compare December 15, 2021 07:53
Copy link

@iclementine iclementine 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

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

lgtm

@paddle-bot-old
Copy link

Sorry to inform you that a6efaf2's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

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

@iclementine iclementine merged commit a3e6f18 into PaddlePaddle:develop Dec 23, 2021
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