Skip to content

[Feature] Tensorclass support for IQLLoss#3864

Open
aehebald wants to merge 1 commit into
pytorch:mainfrom
aehebald:tensorclass-iql-loss
Open

[Feature] Tensorclass support for IQLLoss#3864
aehebald wants to merge 1 commit into
pytorch:mainfrom
aehebald:tensorclass-iql-loss

Conversation

@aehebald

Copy link
Copy Markdown

Description

Makes IQLLoss/DiscreteIQLLoss accept tensorclass inputs, not just TensorDict.
First loss converted as a template for the rest of #1062.

  • Read keys with .get() instead of td[key] ([] is positional indexing on a tensorclass).
  • Add _make_writable() in objectives/utils.py; route network scratch selections through it
    (a tensorclass rejects undeclared out_keys, so convert to TensorDict; dynamic containers pass through).
  • Parametrize test_iql over a tensorclass input + add a tensorclass/TensorDict parity test.

Motivation and Context

#1062 asks for tensorclass support across all losses. This does IQL first so the
approach can be reviewed before applying it to the rest.

Part of #1062

  • I have raised an issue to propose this change

Types of changes

  • New feature (non-breaking change which adds core functionality)

Checklist

  • I have read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.

@pytorch-bot

pytorch-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/3864

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 2 New Failures, 22 Pending

As of commit eefcbc8 with merge base ad8ea7f (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@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 Jun 13, 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. Feature New feature Objectives

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant