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

[PTen]Elementwise_div Kernel Refactor #37418

Merged
merged 2 commits into from
Nov 23, 2021

Conversation

YuanRisheng
Copy link
Contributor

PR types

Others

PR changes

OPs

Describe

move elementwise_div kernel from fluid_dir to pten_dir and refactor it.

@paddle-bot-old
Copy link

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

@YuanRisheng YuanRisheng changed the title elementwise_div refactor [PTen]Elementwise_div Kernel Refactor Nov 22, 2021
Comment on lines +174 to +175
ASSERT_EQ(dense_out.meta().dtype, pten::DataType::FLOAT32);
ASSERT_EQ(dense_out.meta().layout, pten::DataLayout::NCHW);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe dense_out.dtype() and dense_out.layout() is better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -114,6 +114,30 @@ void ElementwiseSub(const CPUContext& dev_ctx,
}
}

template <typename T>
void ElementwiseDiv(const CPUContext& dev_ctx,
Copy link
Contributor

Choose a reason for hiding this comment

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

中间层kernel API和底层kernel API的命名是不是一致比较好,可以后续统一更改下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,下个pr改一下

Copy link
Contributor

@MingMingShangTian MingMingShangTian left a comment

Choose a reason for hiding this comment

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

LGTM

@chenwhql chenwhql merged commit 32d9bee into PaddlePaddle:develop Nov 23, 2021
Zjq9409 pushed a commit to Zjq9409/Paddle that referenced this pull request Dec 10, 2021
* elementwise_div refactor

* fix compile bugs in windows ci
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.

5 participants