Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add inner op #20532

wants to merge 1 commit into from

Conversation

IMvision12
Copy link
Contributor

Inner product of two arrays.

@fchollet

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.13%. Comparing base (a93828a) to head (2141413).

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              
Flag Coverage Δ
keras 81.98% <100.00%> (+0.01%) ⬆️
keras-jax 65.04% <42.50%> (-0.02%) ⬇️
keras-numpy 60.03% <52.50%> (-0.01%) ⬇️
keras-tensorflow 66.02% <52.50%> (-0.02%) ⬇️
keras-torch 64.97% <57.50%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Member

@fchollet fchollet left a 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)
Copy link
Member

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.
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants