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

TracedLayer Error Message Enhancement #25734

Merged
merged 5 commits into from
Jul 29, 2020

Conversation

zhhsplendid
Copy link
Member

@zhhsplendid zhhsplendid commented Jul 27, 2020

PR types

New features

PR changes

APIs

Describe

Enhance TracedLayer Error Message

Note: this PR uses assert to check type somewhere and check_type somewhere, the reason is that the check_type skips checking when it is under dygraph mode.

@paddle-bot-old
Copy link

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

@zhhsplendid zhhsplendid changed the title Enhance TracedLayer Error Message TracedLayer Error Message Enhancement Jul 27, 2020
Aurelius84
Aurelius84 previously approved these changes Jul 28, 2020
for var in inputs:
_extract_vars(var, result_list)
else:
raise TypeError(
"The type of 'each element of inputs' in fluid.dygraph.jit.TracedLayer.trace must be fluid.Variable, but received {}.".
Copy link
Contributor

Choose a reason for hiding this comment

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

自2.0起,所有Variable不再对用户暴漏,全部使用“Tensor”哈~辛苦改下

Copy link
Member Author

Choose a reason for hiding this comment

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

这里的是代码报错,当前代码还是Variable类型,恐怕不适合更改,你看这里还用Variable可以吗?

@@ -1063,7 +1067,8 @@ def trace(layer, inputs):

Args:
layer (dygraph.Layer): the layer object to be traced.
inputs (list(Variable)): the input variables of the layer object.
inputs (list(Variable)|tuple(Variable)|Variable): the input
variables of the layer object.

Copy link
Contributor

Choose a reason for hiding this comment

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

Variable to “Tensor”

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@swtkiwi swtkiwi left a comment

Choose a reason for hiding this comment

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

LGTM

@zhhsplendid zhhsplendid merged commit b3f58d3 into PaddlePaddle:develop Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants