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

[Eager][YAML] Supported array-type parsing for output tensors #40058

Merged

Conversation

jim19930609
Copy link
Contributor

PR types

New features

PR changes

Others

Describe

Before this patch, AutoCodeGen wasn't able to recognize array-typed output tensors in Yaml, for example "... -> Tensor". This feature will be enabled after this patch.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 2, 2022

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

@@ -213,8 +213,12 @@ def ParseYamlReturns(string):

returns = [x.strip() for x in string.strip().split(",")]
for i in range(len(returns)):
ret = returns[i]
returns_list.append(["", ret, i])
ret_type = returns[i]
Copy link
Contributor

Choose a reason for hiding this comment

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

If ret_type is a string like Tensor(out),can it be found in yaml_types_mapping.keys()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay this is interesting. So this function "ParseYamlReturns" is designed for parsing "forward_api" only, and it assumes there's no "name" associated with the outputs, in other words "Tensor[], Tensor" format outputs.

"backward_api", on the other hand, will use "ParseYamlReturnsWithName" instead, which assumes "Tensor(out), Tensor" format outputs.

@jim19930609 jim19930609 merged commit 71c6950 into PaddlePaddle:develop Mar 3, 2022
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.

2 participants