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
⚡️ Speed up method AlexNet._extract_features by 978%
Here's an optimized rewrite of your program. Since the body of the for-loop is `pass` (it does nothing), the entire loop can be removed for maximum speed, and thus, the function can return an empty list immediately. This returns the exact same result as before, but with negligible runtime.
This is now optimal: zero iterations, zero memory allocations inside a loop, and instantly returns. If later you add content inside the loop, further optimizations may be possible depending on the new code.
0 commit comments