-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
TracedLayer Error Message Enhancement #25734
Conversation
Thanks for your contribution! |
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 {}.". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
自2.0起,所有Variable不再对用户暴漏,全部使用“Tensor”哈~辛苦改下
There was a problem hiding this comment.
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. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable to “Tensor”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
APIs
Describe
Enhance TracedLayer Error Message
Note: this PR uses
assert
to check type somewhere andcheck_type
somewhere, the reason is that thecheck_type
skips checking when it is under dygraph mode.