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

How to get raw tensor data? #2294

Open
WenheLI opened this issue Jun 28, 2024 · 2 comments · May be fixed by #2296
Open

How to get raw tensor data? #2294

WenheLI opened this issue Jun 28, 2024 · 2 comments · May be fixed by #2296

Comments

@WenheLI
Copy link

WenheLI commented Jun 28, 2024

I am trying to implement an adaptive avg pool in candle. However, I guess my implementation will require an API to get the raw data/storage (storaged in plain/flatten array format).
Wondering if there is such an API for that?

Thanks!

@EricLBuehler
Copy link
Member

Yes! The Candle CustomOp API allows this: https://docs.rs/candle-core/latest/candle_core/trait.CustomOp1.html

On the CPU, the storage is: https://docs.rs/candle-core/latest/candle_core/cpu_backend/enum.CpuStorage.html

@WenheLI
Copy link
Author

WenheLI commented Jun 28, 2024

Thanks for the quick response! I did an initial implementation on CPU backend
#2296
Let me know if this looks good and I can extend this to other backends.

@WenheLI WenheLI linked a pull request Jun 28, 2024 that will close this issue
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 a pull request may close this issue.

2 participants