-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
steps
argument in Mat::new_nd_with_data()
has a wrong type
#201
Comments
Also |
I think it expects a null pointer, not a pointer to null. Can you please try passing something like |
It won't work. pointer.as_ref() returns |
You’re right! Well, some kind of |
It is my workaround to pass null pointer as reference. Unfortunately, it passes the tests in in debug build but is killed by SIGILL in release build. use platform_types::size_t;
let step: &size_t = mem::transmute(ptr::null() as *const size_t);
core::Mat::new_nd_with_data(&size, typ, tensor.data_ptr(), step)? This is my implementation FYI. |
In my tests it literally generates the asm |
Interesting, TIL there is a x86 instruction causes undefined behavior. |
Can you please check the |
Great. It passes every test even in release build. |
It's now released in v0.49.0 |
The
Mat::new_nd_with_data
(doc) has asteps
argument with type&size_t
. I passed&0
, the suggested default value, and it failed with the message.Look like it treats the reference as an integer. I guess the argument should have the type
size_t
,The text was updated successfully, but these errors were encountered: