-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Added tf dtype generics support in eager mode. #19588
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
Conversation
This is done by extending IRGen to use the new AnyTensorHandle based compiler rt entry points.
@swift-ci please test tensorflow |
This is great, it's awesome to see it all come together!! |
@@ -43,6 +43,46 @@ void *swift_tfc_CreateScalarFloatTensor(int32_t val) { | |||
return tensor; | |||
} | |||
|
|||
void *swift_tfc_CreateScalarIntTensor(int64_t val, int32_t dtype, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why ints and floats have to be in different code paths. Can you explain a bit more, and also add some doc comments at the declaration site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The float version should take as input a float or double value, instead of int64_t val
, so there should be different C APIs for them.
BTW, currently we only have integer related data types like IGM.Int32Ty, but there is no IGM.FloatTy. That can be added though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to add doc documents, because these arguments' types do not directly reflect the underlying data type, and would require the call and the function implementation to cast things back and forth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…API TF_MakeInternalErrorStatus().
@swift-ci please clean test tensorflow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for the review! CI passed, so I'm merging. |
This is done by extending IRGen to use the new AnyTensorHandle based compiler rt
entry points.