-
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 ResizeBilinearGrad and ResizeNearestNeighborGrad kernels #7346
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. The shape abstraction makes indexing much easier to read!
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.
Thank you, nice Shape class.
Reviewable status: complete! 2 of 1 approvals obtained (waiting on @chunnienc)
tfjs-backend-wasm/src/cc/shape.h
line 57 at r1 (raw file):
} inline T& operator[](size_t i) { return data_[i]; }
boundary check on i
?
The operator[] does not do boundary checking, while the |
@mattsoulanille and reviewers: This compiler explorer example https://godbolt.org/z/zGr56TWeT shows that the shape (helper) class and lambda argument are zero-cost in our usage as we discussed. You can see that the generated assembly codes for
Operator1
(with these features) andOperator2
(native implementation) are the same.To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.
This change is