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

Implement Tensor::chunk #27

Closed
jerry73204 opened this issue Apr 19, 2019 · 2 comments · Fixed by #28
Closed

Implement Tensor::chunk #27

jerry73204 opened this issue Apr 19, 2019 · 2 comments · Fixed by #28

Comments

@jerry73204
Copy link
Contributor

tch-rs does not provide torch.chunk. Look like it's missing in f_* functions. The backend seems to be generated by automated means and I would like to follow the convention, so I don't know how to make proper patches for this. Can you implement it or tell me how to make contributions?

@LaurentMazare
Copy link
Owner

Indeed chunk is not handled properly by the code generation part as it only supports functions that return a fixed number of tensors - whereas chunk is one of the rare function from the C++ backend that can return an arbitrary number of tensor.
The relevant bit in the ocaml code generator can be seen here.
It's not entirely straightforward to support as currently the array of returned tensor is allocated on the rust side hence knowing the proper size helps and it's probably the most complicated part of the bindings, I'll give it a try today or tomorrow and will let you know.

@jerry73204
Copy link
Contributor Author

Thanks a lot!

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