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 Dilation2D #7327

Merged
merged 4 commits into from
Feb 1, 2023
Merged

Conversation

chunnienc
Copy link
Collaborator

@chunnienc chunnienc commented Jan 31, 2023

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


This change is Reviewable

Copy link
Member

@mattsoulanille mattsoulanille left a comment

Choose a reason for hiding this comment

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

LGTM!

const {x, filter} = inputs;
const {strides, pad, dilations} = attrs;

if (x.dtype !== filter.dtype) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we move this check to core? As I know, we typically do users' input check in core; otherwise the backends' behaviors could be different.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is intentional: our cpu and webgl backend can take different types and do the type cast automatically, while wasm backend is very hard to do that. Therefore this check is just here to make the wasm implementation easier.

The TF Dilation2D op also has this constraint that x and filter must have the same type, so it should be fine in terms of correctness. However, it will be a breaking change to TFJS if we move this check to core level.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for explanation!

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, thanks!

@chunnienc chunnienc merged commit 7ecf672 into tensorflow:master Feb 1, 2023
@chunnienc chunnienc deleted the wasm-dilation2d branch February 3, 2023 22:10
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