We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For tensors, the following apply,
x = torch.randn(3,4) mask = [True, False, True] y = torch.randn(2,4) x[mask] = y torch.testing.assert_allclose(x[mask],y)
on the other hand for tensordict
td = TensorDict({"a": torch.randn(3, 4, 2), "b": torch.randn(3, 4)}, [3, 4]) mask = torch.tensor([True, False, True]) x = torch.randn(2, 4, 2) td[mask]["a"] = x torch.testing.assert_allclose(td[mask]["a"], x)
returns error AssertionError: Tensor-likes are not close!
AssertionError: Tensor-likes are not close!
Instead of return a new Tensordict using mask-select, we can return instead a SubTensorDict.
The text was updated successfully, but these errors were encountered:
vmoens
Successfully merging a pull request may close this issue.
Motivation
For tensors, the following apply,
on the other hand for tensordict
returns error
AssertionError: Tensor-likes are not close!
Solution
Instead of return a new Tensordict using mask-select, we can return instead a SubTensorDict.
Checklist
The text was updated successfully, but these errors were encountered: