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] Dynamic specs #2143

Merged
merged 27 commits into from
May 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
amend
  • Loading branch information
vmoens committed May 30, 2024
commit 5f506cc71c9781f895f3c5dcaec3e59c48fd0e21
9 changes: 0 additions & 9 deletions torchrl/data/tensor_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,18 +742,9 @@ def is_in(self, val: torch.Tensor) -> bool:
Returns:
boolean indicating if values belongs to the TensorSpec box

.. note:: The same result can be obtained through ``sample in spec``.

"""
raise NotImplementedError

def __contains__(self, item):
"""Returns whether a sample is contained within the space defined by the TensorSpec.

See :meth:`~.is_in` for more information.
"""
return self.is_in(item)

def contains(self, item):
"""Returns whether a sample is contained within the space defined by the TensorSpec.

Expand Down
Loading