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

[Dy2Stat]Add build_strategy in @to_static to support open pass #34347

Merged
merged 4 commits into from
Jul 28, 2021

Conversation

Aurelius84
Copy link
Contributor

@Aurelius84 Aurelius84 commented Jul 23, 2021

PR types

New features

PR changes

APIs

Describe

Add build_strategy argument in @to_static to support open pass

A sample code:

build_strategy = paddle.static.BuildStrategy()

class ResNet(nn.Layer):
    def __init__(self, ...):
        # (略)


    #方式一:
    @paddle.jit.to_static(build_strategy=build_strategy)
    def forward(self, x):
        # (略)


resnet = ResNet()
# 方式二:
resnet = paddle.jit.to_static(resnet, build_strategy=build_strategy)

image

@paddle-bot-old
Copy link

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

Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM for adding widnows UT

Copy link
Contributor

@XieYunshen XieYunshen left a comment

Choose a reason for hiding this comment

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

LGTM for set_tests_properties(test_build_strategy PROPERTIES TIMEOUT 120)

Copy link

@PangHua PangHua left a comment

Choose a reason for hiding this comment

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

LGTM

@Aurelius84 Aurelius84 merged commit eb27d8b into PaddlePaddle:develop Jul 28, 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.

7 participants