Skip to content

[Deprecation] Deprecate TensorDictModule.device - #1769

Closed
vmoens wants to merge 3 commits into
pytorch:mainfrom
vmoens:deprecate-tdmodule-device
Closed

[Deprecation] Deprecate TensorDictModule.device#1769
vmoens wants to merge 3 commits into
pytorch:mainfrom
vmoens:deprecate-tdmodule-device

Conversation

@vmoens

@vmoens vmoens commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Description

Deprecates TensorDictModule.device in TensorDict 0.15 and schedules its removal for TensorDict 0.17. A module may contain parameters and buffers on multiple devices, so a single inferred device is not a valid module-level property.

The property retains its existing behavior during the deprecation window and emits a DeprecationWarning with the removal version. The generated API documentation also marks it as deprecated. No replacement scalar-device API is introduced.

This PR is stacked on #1767 and should merge after it. Once #1767 lands, this branch can be rebased onto main.

Test plan

  • python -m pytest test/nn/test_nn.py -k "repr or device_deprecation" -q
  • python -m pytest test/nn -q (610 passed, 1 skipped)
  • Black, critical Ruff checks, and git diff --check

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 21, 2026
@github-actions github-actions Bot added Deprecation Announces or enacts a deprecation Test nn and removed Deprecation Announces or enacts a deprecation labels Aug 21, 2026
@vmoens
vmoens marked this pull request as ready for review August 21, 2026 13:31
@vmoens vmoens closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. nn Test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant