Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perf: replace unnecessary
torch.split
with indexing (#4505)
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 -->
- Loading branch information