-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[wasm] Add Dilation2D #7327
Conversation
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.
LGTM!
const {x, filter} = inputs; | ||
const {strides, pad, dilations} = attrs; | ||
|
||
if (x.dtype !== filter.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.
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.
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.
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.
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 explanation!
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.
LGTM, thanks!
To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.
This change is