Implementation of two helper functions 'empty_like' & 'from_bytes' #798
prashant-saxena
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to implement these two functions using c++
First
auto arr = empty_like(nb::ndarray b);
arr will be same like b in terms of shape, size, dtype & device type but no data
Second
auto arr = from_bytes(nb::bytes bytes, nb::dtype dtype);
Function will convert byte string to nb::ndarray of dtype. From python side, we can call
This is what have I tried for one fixed dtype int
The code is throwing all type of errors. Any pointers?
Question 1
What's the correct syntax to use generic dtype as function parameter?
doesn't work
Beta Was this translation helpful? Give feedback.
All reactions