Skip to content

Fix defaultdict batch tensor conversion - #3891

Merged
vfdev-5 merged 2 commits into
pytorch:masterfrom
ktz03:fix-defaultdict-batch-conversion
Oct 14, 2026
Merged

vfdev-5 merged 2 commits into
pytorch:masterfrom
ktz03:fix-defaultdict-batch-conversion

Conversation

@ktz03

@ktz03 ktz03 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3890

Description:

Follow PyTorch's mapping-conversion branches, including copy/update for mutable mappings and a plain dict fallback on TypeError. Add one defaultdict case to the existing test_convert_tensor.

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@vfdev-5

vfdev-5 commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

@ktz03 can you simplify the PR description to strictly minimum of what is done now in the PR. Thanks!

@ktz03

ktz03 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Done, reduced to the current mapping change and the single existing-test case.

@vfdev-5 vfdev-5 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@vfdev-5
vfdev-5 added this pull request to the merge queue Oct 14, 2026
Merged via the queue into pytorch:master with commit 7eb1d1f Oct 14, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: utils Utils module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

convert_tensor fails on default-collated defaultdict batches

2 participants