Skip to content

Number constant ops #210

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

Merged
merged 1 commit into from
Feb 11, 2021
Merged

Conversation

rnett
Copy link
Contributor

@rnett rnett commented Feb 5, 2021

Adds a constant ops that takes Number and a TNumber class, and one that does the same based off of an Operand's runtime type. The conversion is done using Number.doubleValue() etc rather than cast, since it avoids adding an op, and is necessary to call the other constant ops. It's useful when you want to create a composite op that works with any numeric types, but need to add a constant, or for enabling things like the + operator in Kotlin to not need a new overload for each scalar type.

Signed-off-by: Ryan Nett <[email protected]>
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 3044d4b into tensorflow:master Feb 11, 2021
@rnett rnett deleted the rn_more_constants 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