-
Notifications
You must be signed in to change notification settings - Fork 2k
Modularise resizeBilinear and resizeNearestNeighbor #3430
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
Conversation
lina128
left a comment
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.
Reviewable status:
complete! 1 of 1 approvals obtained (waiting on @annxingyuan and @tafsiri)
tfjs-backend-wasm/src/kernels/ResizeBilinear.ts, line 44 at r1 (raw file):
function resizeBilinear( params: {backend: {}, inputs: NamedTensorInfoMap, attrs: NamedAttrMap}):
Hi Yannick, other kernels use args, do we have to change all the other ones to params? Also why can't backend type be BackendWasm, same for inputs and attrs.
tafsiri
left a comment
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.
Reviewable status:
complete! 1 of 1 approvals obtained (waiting on @annxingyuan and @lina128)
tfjs-backend-wasm/src/kernels/ResizeBilinear.ts, line 44 at r1 (raw file):
Previously, lina128 (Na Li) wrote…
Hi Yannick, other kernels use args, do we have to change all the other ones to params? Also why can't backend type be BackendWasm, same for inputs and attrs.
Hmm, i was getting a compiler error at some point but no longer with some of these.
I've changed params back to args and the type of backend to BackendWasm,
However if inputs and attrs are the ResizeBilinear* types then registerKernel won't compile because the types don't overlap with the signature of kernelFunc specifies, same reasons we cast attrs to {} before casting back to ResizeBilinearAttrs. Tbh i'm not 100% sure why this worked before, my suspicion is that because ResizeBilinearInputs and ResizeBilinearAttrs were defined within this file as opposed to being imported from core.
Good catch.
lina128
left a comment
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.
Reviewable status:
complete! 1 of 1 approvals obtained (waiting on @annxingyuan and @tafsiri)
tfjs-backend-wasm/src/kernels/ResizeBilinear.ts, line 44 at r1 (raw file):
Previously, tafsiri (Yannick Assogba) wrote…
Hmm, i was getting a compiler error at some point but no longer with some of these.
I've changed
paramsback toargsand the type of backend to BackendWasm,However if inputs and attrs are the ResizeBilinear* types then registerKernel won't compile because the types don't overlap with the signature of kernelFunc specifies, same reasons we cast attrs to {} before casting back to ResizeBilinearAttrs. Tbh i'm not 100% sure why this worked before, my suspicion is that because ResizeBilinearInputs and ResizeBilinearAttrs were defined within this file as opposed to being imported from core.
Good catch.
Hmm, that's interesting. This kernel that I recently touched compiles ok with input and attr type from kernel name: https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/src/kernels/AvgPool.ts#L48
To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.
This change is