Skip to content

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

Merged
merged 3 commits into from
Sep 28, 2018

Conversation

mhong
Copy link

@mhong mhong commented Sep 27, 2018

This is done by extending IRGen to use the new AnyTensorHandle based compiler rt
entry points.

This is done by extending IRGen to use the new AnyTensorHandle based compiler rt
entry points.
@mhong
Copy link
Author

mhong commented Sep 27, 2018

@swift-ci please test tensorflow

@lattner
Copy link
Contributor

lattner commented Sep 27, 2018

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,
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

@mhong
Copy link
Author

mhong commented Sep 27, 2018

@swift-ci please clean test tensorflow

Copy link
Contributor

@rxwei rxwei left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@bgogul bgogul left a comment

Choose a reason for hiding this comment

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

LGTM.

@mhong
Copy link
Author

mhong commented Sep 28, 2018

Thanks for the review! CI passed, so I'm merging.

@mhong mhong merged commit 7eb1710 into swiftlang:tensorflow Sep 28, 2018
@mhong mhong deleted the irgen_6_generics branch September 28, 2018 01:47
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.

4 participants