Replies: 2 comments 2 replies
-
I would probably use
because it's short and clear. Is it the fastest method? I don't know. You will have to test. Maybe
is faster (but uglier). Create a benchmark and test it. As for your second question. No. Arrays of shapes |
Beta Was this translation helpful? Give feedback.
2 replies
-
For all Dimension impls (except IxDyn), ndim is a compile time known quantity. Thus this is like a compile time known conditional, which can be useful to have there for optimization. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is the following code the most efficient way of modifying an existing ndarray and assigning to another pre-allocated one of the same shape but different type?
I was also checking
zip_mut_with
source code. Why does it checkself.dim.ndim() == rhs.dim.ndim()
? Isn't theself.shape() == rhs.shape()
check enough?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions