Skip to content
Snippets Groups Projects
user avatar
CSH authored
## Motivation

Original motivation was after [MMDetection PR
#9533](https://github.com/open-mmlab/mmdetection/pull/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: default avatarMeowZheng <meowzheng@outlook.com>
2e27f8b6
History
Name Last commit Last update