-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Add inner op #20532
base: master
Are you sure you want to change the base?
Add inner op #20532
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20532 +/- ##
==========================================
+ Coverage 82.11% 82.13% +0.01%
==========================================
Files 515 515
Lines 47806 47846 +40
Branches 7490 7492 +2
==========================================
+ Hits 39258 39298 +40
Misses 6736 6736
Partials 1812 1812
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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.
Thanks for the PR!
compute_dtype = dtypes.result_type(result_dtype, float) | ||
x1 = tf.cast(x1, compute_dtype) | ||
x2 = tf.cast(x2, compute_dtype) | ||
return tf.cast(tf.experimental.numpy.inner(x1, x2), result_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.
Whenever possible we should avoid relying on tf.experimental.numpy
. Can you just in-line the implementation here?
|
||
Returns: | ||
Output tensor. The shape of the output is determined by broadcasting the | ||
shapes of x1 and x2 after removing their last axes. |
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.
Add backticks around code keywords.
Inner product of two arrays.
@fchollet