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] Add DenseBincount kernel #7267

Merged
merged 5 commits into from
Jan 19, 2023

Conversation

chunnienc
Copy link
Collaborator

@chunnienc chunnienc commented Jan 12, 2023

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


This change is Reviewable

@chunnienc chunnienc marked this pull request as ready for review January 12, 2023 18:57
Copy link
Collaborator

@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: 0 of 1 approvals obtained (waiting on @chunnienc and @Linchenn)


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

template <typename T>
inline void Bincount1D(const int32_t* x_buf, int32_t x_len, int32_t size,

this function could be shared with bincount op, should these two function be separated in a new file?


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

                       bool binary_output, T* out_buf) {
  for (int32_t i = 0; i < x_shape_0; ++i) {
    Bincount1D(x_buf + i * x_shape_1, x_shape_1, size,

good refactoring, nicely done!

@chunnienc
Copy link
Collaborator Author

chunnienc commented Jan 13, 2023

this function could be shared with bincount op, should these two function be separated in a new file?

I will move them to Bincount.h in the PR adding the bincount op/kernel later.

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

@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 @chunnienc)

@chunnienc chunnienc merged commit 405bfb5 into tensorflow:master Jan 19, 2023
@chunnienc chunnienc deleted the wasm-densebincount branch January 19, 2023 17:59
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.

3 participants