Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement]Replace numpy ascontiguousarray with torch contiguous to…
… speed-up (#2604) ## Motivation Original motivation was after [MMDetection PR #9533](open-mmlab/mmdetection#9533) With several experiments I found out that if a ndarray is contiguous, numpy.transpose + torch.contiguous perform better, while if not, then use numpy.ascontiguousarray + numpy.transpose ## Modification Replace numpy.ascontiguousarray with torch.contiguous in [PackSegInputs](https://github.com/open-mmlab/mmsegmentation/blob/1.x/mmseg/datasets/transforms/formatting.py) Co-authored-by: MeowZheng <meowzheng@outlook.com>
- Loading branch information