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

[wasm] added reciprocal op support for wasm #6992

Merged
merged 2 commits into from Oct 31, 2022
Merged

Conversation

pyu10055
Copy link
Collaborator

@pyu10055 pyu10055 commented Oct 31, 2022

fixed #6971
To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

#include "tfjs-backend-wasm/src/cc/unary.h"

namespace {
float reciprocal(const float a) { return 1 / a; }
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Do we need to account for divide by zero? I assume we're not supporting that yet since we don't propagate NaNs.

Copy link
Collaborator

@Linchenn Linchenn 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
Collaborator Author

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 2 of 1 approvals obtained (waiting on @mattsoulanille)


tfjs-backend-wasm/src/cc/kernels/Reciprocal.cc line 25 at r1 (raw file):

Previously, mattsoulanille (Matthew Soulanille) wrote…

Nit: Do we need to account for divide by zero? I assume we're not supporting that yet since we don't propagate NaNs.

In core, there is a NaN propagation test.

Copy link
Collaborator Author

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 2 of 1 approvals obtained (waiting on @mattsoulanille)


tfjs-backend-wasm/src/cc/kernels/Reciprocal.cc line 25 at r1 (raw file):

Previously, pyu10055 (Ping Yu) wrote…

In core, there is a NaN propagation test.

as well as Infinity test

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.

[WASM] missing op reciprocal
3 participants