pytorch / pytorch/rl

[Feature Request] Improvements to LazyStackedTensorSpec, LazyStackedCompositeSpec

Open
#969 0 comments 0 reactions 1 assignee View on GitHub

@vmoens is already working on this.

Since Mar 15, 2023.

enhancement
Dominant language
Python
Stars
3.6k
Forks
487
Avg merge
1d 1h
Merged PRs (30d)
207

Description

Motivation

#892 introduced two new classes: LazyStackedTensorSpec, and LazyStackedCompositeSpec. These allow us to stack heterogeneous TensorSpec and CompositeSpec respectively.

These classes are missing a few features that still need to be added.

TODO

  • Add documentation - the classes have basic docstrings, but we should add examples etc.
  • Add support for nestedtensors
  • #960 changed the behaviour of torch.stack to only return lazy stacks in the heterogenous case. As a result a number of tests now only cover the homogeneous or heterogeneous case but not both. These tests need to be expanded to cover both cases.

Unimplemented methods - the following exist as unimplemented placeholder methods in LazyStackedTensorSpec and LazyStackedCompositeSpec respectively

LazyStackedTensorSpec

  • __eq__ (requires unbind?)
  • __len__
  • project
  • is_in
  • encode (not relevant, should be removed)
  • __iter__
  • __setitem__

LazyStackedCompositeSpec

  • update
  • __eq__
  • __len__
  • project
  • is_in
  • type_check
  • encode
  • __delitem__
  • __iter__
  • __setitem__

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.