Skip to content

[TF] Re-implement tensor shape/rank operators using TFE runtime APIs. #24949

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

Closed
wants to merge 1 commit into from

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented May 21, 2019

Do not merge. See if it's faster.

@rxwei rxwei added the tensorflow This is for "tensorflow" branch PRs. label May 21, 2019
@rxwei rxwei requested a review from pschuh May 21, 2019 08:52
@rxwei
Copy link
Contributor Author

rxwei commented May 21, 2019

@swift-ci please test tensorflow

Copy link
Contributor

@pschuh pschuh left a comment

Choose a reason for hiding this comment

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

This is actually good to submit as-is if it is better for performance. Because this already converts shapeTensor and rankTensor to scalars, this won't hurt tracing or graph extraction.

@rxwei
Copy link
Contributor Author

rxwei commented May 21, 2019

This actually segfaults on macOS.

@eaplatanios
Copy link

@rxwei Implemented in tensorflow/swift-apis#141.

@rxwei rxwei closed this May 30, 2019
@rxwei rxwei deleted the drop-shape-op branch May 30, 2019 22:23
rxwei pushed a commit to tensorflow/swift-apis that referenced this pull request May 31, 2019
Ported from swiftlang/swift#24949.

Gives a 98% speedup for `Tensor.rank` and 85% speedup for `Tensor.shape` (for a 2x3 tensor) on a MacBook Pro.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tensorflow This is for "tensorflow" branch PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants