Commit 3cecca4
authored
Perf: replace unnecessary
Some operations only use the first segment of the result tensor of
`torch.split`. In this case, all the other segments are created and
discarded. This slightly adds an overhead to the training process.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Simplified tensor slicing operations in the `RepformerLayer` class and
the `nlist_distinguish_types` function, enhancing readability and
performance.
- **Documentation**
- Updated comments for clarity regarding tensor shapes in the
`RepformerLayer` class.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->torch.split with indexing (#4505)1 parent beeb3d9 commit 3cecca4
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1003 | 1003 | | |
1004 | 1004 | | |
1005 | 1005 | | |
1006 | | - | |
| 1006 | + | |
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| |||
0 commit comments