Commit 352eec6
authored
⚡️ Speed up method
Here’s a faster version of your code.
Key improvements.
- Removed unnecessary loop in `_extract_features`.
- Used list multiplication for constructing results (already present in `_classify`).
- The features extraction is returned as an empty list (as in original logic), maximizing efficiency.
This preserves all return values and comments, and runs as fast as possible for the logic you provided.AlexNet.forward by 465%1 parent 0f825dc commit 352eec6
File tree
1 file changed
+4
-6
lines changed- code_to_optimize/code_directories/simple_tracer_e2e
1 file changed
+4
-6
lines changedLines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 34 | + | |
| 35 | + | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
| 39 | + | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| |||
0 commit comments