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

[Doc] Add documentation for masks in tensor specs #2289

Merged
merged 2 commits into from
Jul 11, 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
amend
  • Loading branch information
vmoens committed Jul 11, 2024
commit b0cc6f5055f47a72c4fe6c7fca9835143206d4d4
24 changes: 12 additions & 12 deletions torchrl/data/tensor_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1370,9 +1370,9 @@ def n(self):
return self.space.n

def update_mask(self, mask):
"""
Sets a mask to prevent some of the possible outcomes when a sample is
taken. The mask can also be set during initialization of the spec.
"""Sets a mask to prevent some of the possible outcomes when a sample is taken.

The mask can also be set during initialization of the spec.

Args:
mask (torch.Tensor or None): boolean mask. If None, the mask is
Expand Down Expand Up @@ -2587,9 +2587,9 @@ def __init__(
self.update_mask(mask)

def update_mask(self, mask):
"""
Sets a mask to prevent some of the possible outcomes when a sample is
taken. The mask can also be set during initialization of the spec.
"""Sets a mask to prevent some of the possible outcomes when a sample is taken.

The mask can also be set during initialization of the spec.

Args:
mask (torch.Tensor or None): boolean mask. If None, the mask is
Expand Down Expand Up @@ -2980,9 +2980,9 @@ def n(self):
return self.space.n

def update_mask(self, mask):
"""
Sets a mask to prevent some of the possible outcomes when a sample is
taken. The mask can also be set during initialization of the spec.
"""Sets a mask to prevent some of the possible outcomes when a sample is taken.

The mask can also be set during initialization of the spec.

Args:
mask (torch.Tensor or None): boolean mask. If None, the mask is
Expand Down Expand Up @@ -3429,9 +3429,9 @@ def __init__(
self.remove_singleton = remove_singleton

def update_mask(self, mask):
"""
Sets a mask to prevent some of the possible outcomes when a sample is
taken. The mask can also be set during initialization of the spec.
"""Sets a mask to prevent some of the possible outcomes when a sample is taken.

The mask can also be set during initialization of the spec.

Args:
mask (torch.Tensor or None): boolean mask. If None, the mask is
Expand Down
Loading