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

[x86] add instance norm #5860

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

zhangjun
Copy link
Collaborator

@zhangjun zhangjun commented Apr 7, 2021

description

add instance norm

@paddle-bot-old
Copy link

paddle-bot-old bot commented Apr 7, 2021

Thanks for your contribution!

@zhangjun
Copy link
Collaborator Author

zhangjun commented Apr 8, 2021

@zhaoyang-star

kNCHW,
paddle::lite::kernels::x86::InstanceNormCompute,
def)
.BindInput("X", {LiteType::GetTensorTy(TARGET(kX86))})
Copy link
Collaborator

Choose a reason for hiding this comment

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

还需要增加MeanOut, ReserveSpace, VarianceOut 这三个 arg_name;具体可以参考 arm backend 中的 bn kernel 注册。

namespace x86 {
namespace math {

void instance_norm(const float* in,
Copy link
Collaborator

Choose a reason for hiding this comment

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

有快速计算方法,PrepareForRun函数中计算好 new_scale 和 new_bias,在Run函数中只计算 new_scale * in + new_bias 即可。

Copy link
Collaborator

@zhaoyang-star zhaoyang-star left a comment

Choose a reason for hiding this comment

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

2个comments

Copy link
Collaborator

@zhaoyang-star zhaoyang-star left a comment

Choose a reason for hiding this comment

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

LGTM

@zhaoyang-star zhaoyang-star merged commit eb67a65 into PaddlePaddle:develop Apr 13, 2021
@zhangjun zhangjun deleted the instance_norm_x86 branch October 20, 2021 05:39
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