-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Prim][PIR] group_norm decomposite rule support dynamic shape #62793
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
self.init_x_shape = [None, 640, None, None] | ||
self.x = np.random.random(self.x_shape).astype(self.dtype) | ||
self.net = group_norm_net1 | ||
self.necessary_ops = "pd_op.flatten" |
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.
group_norm
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.
Done
Tensor x_shape = get_slice<T>(x_dim, 0) * groups; | ||
Tensor dim_1 = full<T>({1}, -1, x_dim.type()); | ||
x_shape = concat<T>({x_shape, dim_1}); | ||
x_cast = backend::reshape<T>(x_cast, x_shape); |
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.
x_cast = backend::reshape<T>(x_cast, x_shape); | |
x_cast = reshape<T>(x_cast, x_shape); |
Tensor dim_1 = full<T>({1}, -1, x_dim.type()); | ||
x_shape = concat<T>({x_shape, dim_1}); | ||
x_cast = backend::reshape<T>(x_cast, x_shape); | ||
mean_ = mean_decomp<T>(x_cast, IntArray(one_axis), true); |
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.
remove IntArray
PR types
New features
PR changes
Others
Description
support dynamic shape for group_norm