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

support inputs as list and add some OPs support #723

Merged
merged 12 commits into from
Jan 11, 2022
Merged

support inputs as list and add some OPs support #723

merged 12 commits into from
Jan 11, 2022

Conversation

yeliang2258
Copy link
Collaborator

@yeliang2258 yeliang2258 commented Dec 22, 2021

Create A Good Pull Request

下面的文字请保留在PR说明的最后面,并在提完PR后,根据实际情况勾选确认以下情况

  1. Add Sin、Neg、SpaceToDepth、Cos and GatherElement
  2. Fix Upsample、gather and Slice
  3. Fix _rename_or_remove_weight
  4. 增加list类型输入的支持,解决meshgrid等API的输入只能是list类型的问题。
paddle.meshgrid(*args, **kwargs)

Please check the follow step before merging this pull request

  • Python code style verification
  • Review all the code diff by yourself
  • All models(TensorFLow/Caffe/ONNX/PyTorch) testing passed
  • Details about your pull request, releated issues

If this PR add new model support, please update model_zoo.md and add model to out test model zoos(@wjj19950828)

  • New Model Supported
  • No New Model Supported

@yeliang2258 yeliang2258 changed the title fix onnx convert support inputs as list and add some OP support Jan 5, 2022
@yeliang2258 yeliang2258 changed the title support inputs as list and add some OP support support inputs as list and add some OPs support Jan 5, 2022
shape=[1],
fill_value=-1)
self.paddle_graph.add_layer(
"paddle.multiply",
Copy link
Contributor

Choose a reason for hiding this comment

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

为啥不能直接用paddle.neg

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator Author

@yeliang2258 yeliang2258 Jan 10, 2022

Choose a reason for hiding this comment

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

paddle.neg是paddle 2.2之后才有的API,新增了一个判断,2.2之后使用paddle.neg,否则还是-1来乘。

data = weights.pop(origin_name)
else:
data = weights[origin_name]
data = weights[origin_name]
Copy link
Contributor

Choose a reason for hiding this comment

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

这个remove逻辑删除的原因是?

Copy link
Collaborator Author

@yeliang2258 yeliang2258 Jan 7, 2022

Choose a reason for hiding this comment

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

一个权重可能和多个算子相关,不能一个算子之后直接将权重pop出来

Copy link
Contributor

Choose a reason for hiding this comment

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

如若不删除这个weights,会有什么影响,是否会导致转换后的inference模型更大

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done,改回去了

@yeliang2258 yeliang2258 merged commit 9247ffc into PaddlePaddle:develop Jan 11, 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