Skip to content

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