Skip to content

Conversation

@rnett
Copy link
Contributor

@rnett rnett commented Feb 11, 2021

Adds custom ops for boolean masking (tensor[mask] and tensor[mask] = update).

Note that there is no Python equivalent of BooleanMaskUpdate, but there is in Numpy and PyTorch, so I included it.

Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
Signed-off-by: Ryan Nett <[email protected]>
@rnett
Copy link
Contributor Author

rnett commented Feb 11, 2021

I can't run tests locally b/c jnitensorflow in java.library.path errors, I'm guessing because snapshot builds were just fixed. The CI runs them fine though.

public Scope withNameAsSubScope(String defaultName){
return new Scope(env, nameScope.withSubScope(nameScope.makeOpName(defaultName)), controlDependencies, deviceSpec);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be interesting to update our other composite ops to make use of this new method, like this one:

Copy link
Collaborator

@karllessard karllessard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rnett !

@karllessard karllessard merged commit 439373d into tensorflow:master Feb 23, 2021
@rnett rnett deleted the rn_boolean_mask branch October 17, 2021 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants