-
Notifications
You must be signed in to change notification settings - Fork 1.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
[x86] add instance norm #5860
[x86] add instance norm #5860
Conversation
Thanks for your contribution! |
kNCHW, | ||
paddle::lite::kernels::x86::InstanceNormCompute, | ||
def) | ||
.BindInput("X", {LiteType::GetTensorTy(TARGET(kX86))}) |
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.
还需要增加MeanOut
, ReserveSpace
, VarianceOut
这三个 arg_name;具体可以参考 arm backend 中的 bn kernel 注册。
namespace x86 { | ||
namespace math { | ||
|
||
void instance_norm(const float* in, |
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.
有快速计算方法,PrepareForRun
函数中计算好 new_scale 和 new_bias,在Run
函数中只计算 new_scale * in + new_bias 即可。
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个comments
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
description
add instance norm