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
Giving the ability of .masked_select() inplace for the TensorDictBase.
.masked_select()
TensorDictBase
Giving the ability of .masked_select() like but modification-inplace for the TensorDictBase, by a method named .masked_select_().
.masked_select_()
Main steps to achieve this:
Examples:
td = TensorDict(source={'a': torch.zeros(3, 4)}, batch_size=[3]) mask = torch.tensor([True, False, False]) td.masked_select_(mask) td.get("a") #output: tensor([[0., 0., 0., 0.]])
The text was updated successfully, but these errors were encountered:
vmoens
No branches or pull requests
Motivation
Giving the ability of
.masked_select()
inplace for theTensorDictBase
.Solution
Giving the ability of
.masked_select()
like but modification-inplace for theTensorDictBase
, by a method named.masked_select_()
.Main steps to achieve this:
Examples:
The text was updated successfully, but these errors were encountered: