Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] DynamicTensorSpec a TensorSpec for sequential data #2136

Closed
1 task done
dtsaras opened this issue Apr 29, 2024 · 1 comment
Closed
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@dtsaras
Copy link

dtsaras commented Apr 29, 2024

Motivation

There is currently no TensorSpec such that it allows sequential data. For example, if an environment was supposed to represent a sentence, it would be represented as (batch_size, sequence_len, embedding_size). Such a TensorSpec could also be used for graphs or any other application that is represented as sequence.Since, the length sequence is not fixed it would helpful to allow to define a TensorSpec with shape (batch_size, -1, embedding_size). In such cases, the embedding_size is fixed and -1 represent the dynamic shape of the length of the sequence.

Solution

Such a TensorSpec would have to be described by either a nested tensor, LazyStackedTensorDict or a padded tensor.

Alternatives

Currently, it's not possible to have any such structure in TorchRL. By using other TensorSpecs can solve the issue if as long as we avoid enforcing the shape restrictions and we don't use batched ends.

Checklist

  • I have checked that there is no similar issue in the repo (required)
@dtsaras dtsaras added the enhancement New feature or request label Apr 29, 2024
@dtsaras dtsaras changed the title [Feature Request] DynamicTensorSpec [Feature Request] DynamicTensorSpec a TensorSpec for sequential data Apr 29, 2024
@vmoens
Copy link
Contributor

vmoens commented Jun 7, 2024

Closed by #2143

@vmoens vmoens closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants