You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0308]: mismatched types
--> src/lib.rs:93:45
|
93 | ndarray_ndimage::convolve(&bnd, &corner_kernel.view(), BorderMode::Mirror, ORIGIN);
| ------------------------- ^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
| |
| arguments to this function are incorrect
|
= note: expected reference `&ArrayBase<ViewRepr<&mut f32>, Dim<[usize; 2]>>`
found reference `&ArrayBase<ViewRepr<&f32>, Dim<[usize; 2]>>`
I belive this is because of convolve's signature. Since both data and weights have the same generic parameters, the compiler expects them to both have the exact same types, which, I suspect, is probably not necessary?
You're right. It should not be necessary for both arrays to have the exact same type. I could accept mut/not mut, owned/view without any problem. I'm allocating and copying a new weights anyway because it needs to be reversed (which is totally useless for the kernel you use... I guess that could be optimized!)
It's probably done that way because I simply copied data definition without thinking about that case.
I am trying to convolve over the 2D arrays in an image cube and noticed the following mismatched types error.
Error:
I belive this is because of
convolve
's signature. Since bothdata
andweights
have the same generic parameters, the compiler expects them to both have the exact same types, which, I suspect, is probably not necessary?The text was updated successfully, but these errors were encountered: