Skip to content

Avoid contiguous error for default_collate#1688

Open
Darejkal wants to merge 1 commit into
open-mmlab:mainfrom
Darejkal:patch-1
Open

Avoid contiguous error for default_collate#1688
Darejkal wants to merge 1 commit into
open-mmlab:mainfrom
Darejkal:patch-1

Conversation

@Darejkal

Copy link
Copy Markdown

Motivation

Avoid contiguous error for default_collate. When input of type np array is not contiguous, torch default collate might throw error.

Modification

Add an additional if that check if numpy then ensure it is contiguous before collate

BC-breaking (Optional)

No

Use cases (Optional)

No

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDetection or MMPretrain.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@CLAassistant

CLAassistant commented Jun 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants