-
Notifications
You must be signed in to change notification settings - Fork 906
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
How do pixel unshuffle in ggml ? #732
Comments
Maybe as a sequence of views and 4D permutes: x_view = x.view(b*c, h, scale, w*scale)
x_view = x_view.permute(0, 2, 1, 3)
x_view = x.view(b*c*scale, h, w, scale)
x_view = x_view.permute(0, 3, 1, 2)
return x_view.reshape(b, out_channel, h, w) (not sure if this is correct so verify) If it is correct, it would be something like this in x = ggml_reshape_4d(ctx, x, w*scale, scale, h, b*c);
x = ggml_permute (ctx, x, 0, 2, 1, 3);
x = ggml_cont (ctx, x);
x = ggml_reshape_4d(ctx, x, scale, w, h, b*c*scale);
x = ggml_permute (ctx, x, 2, 0, 1, 3);
x = ggml_cont (ctx, x);
x = ggml_reshape_4d(ctx, x, w, h, out_channel, b); |
Thanks@ggerganov , we tested, the answer is not correct. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear friends,
We have following pytorch code in esrgan network, hope to used in ggml, would you like show us how to do in ggml ?
As you know, ggml tensor default maximum dims is 4, but here view and permute is 6. We need change GGML_MAX_DIMS to 6 ?
The text was updated successfully, but these errors were encountered: