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

Support for Custom Data Types in ggml_arange Function #869

Open
WenheLI opened this issue Jun 22, 2024 · 1 comment
Open

Support for Custom Data Types in ggml_arange Function #869

WenheLI opened this issue Jun 22, 2024 · 1 comment

Comments

@WenheLI
Copy link

WenheLI commented Jun 22, 2024

Currently, ggml_arange can only generate f32 tensors. I am wondering if there is a way to modify or extend this function to allow ggml_arange to produce tensors of different data types, specifically i32. Any guidance or pointers on where to make these changes in the codebase would be greatly appreciated.

Or if there is any cast method like pytorch's to that I can directly cast it.

Would also love to contribute to that method if there is no quick way to achieve that in the current implementation.

@ggerganov
Copy link
Owner

You can use ggml_cast(ctx, a, GGML_TYPE_I32) to cast the result to i32

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

No branches or pull requests

2 participants