pytorch / rl

A modular, primitive-first, python-first PyTorch library for Reinforcement Learning.
https://pytorch.org/rl
MIT License
2.24k stars 296 forks source link

Switch maybe_dense_stack calls from TensorDict to LazyStackedTensorDict #2238

Closed c3-utsavdutta98 closed 2 months ago

c3-utsavdutta98 commented 3 months ago

Bug in _use_buffers = False, in the case of non-contiguous tensors. Updated all calls to TensorDict.maybe_dense_stack(...) to LazyStackedTensorDict.maybe_dense_stack(...)

Description

When using _use_buffers = False, the code invokes TensorDict.maybe_dense_stack instead of the LazyStackedTensorDict class, which is where the API is supported. This PR aims to fix this bug.

Motivation and Context

Why is this change required? What problem does it solve? If it fixes an open issue, please link to the issue here. You can use the syntax close #15213 if this solves the issue #15213

Types of changes

What types of changes does your code introduce? Remove all that do not apply:

Checklist

Go over all the following points, and put an x in all the boxes that apply. If you are unsure about any of these, don't hesitate to ask. We are here to help!

pytorch-bot[bot] commented 3 months ago

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/2238

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

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

facebook-github-bot commented 3 months ago

Hi @c3-utsavdutta98!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

vmoens commented 3 months ago

This is because you need tensordict nightly I believe, can you check if that fixes your bug?

vmoens commented 2 months ago

Closing due to inactivity - happy to reopen if needed