-
Notifications
You must be signed in to change notification settings - Fork 26.3k
C++ API: torch::nn::BatchNorm{2,3}d #28936
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
yf225
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.
@nuka137 Thanks so much for the awesome work and thorough tests! I have one very minor comment.
| "expected 5D input (got ", input.dim(), "D input)"); | ||
| } | ||
|
|
||
| template class BatchNormImplBase<3, BatchNorm3dImpl>; |
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.
From code organization point of view, it would be awesome to have all template specializations next to each other for easier discovery:
template class BatchNormImplBase<1, BatchNorm1dImpl>;
template class BatchNormImplBase<2, BatchNorm2dImpl>;
template class BatchNormImplBase<3, BatchNorm3dImpl>;Thanks so much for your help!
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. Fixed it.
|
Thanks for your review. I fixed the source code you commented. |
yf225
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.
@nuka137 Thanks so much for the awesome work!
facebook-github-bot
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.
@yf225 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
TEsts are failing: |
|
@nuka137 Sorry it was my fault that causes this PR to be reverted - I will re-open this PR and make fixes directly to this PR, and then makes sure it passes CI before merging again. |
facebook-github-bot
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.
@yf225 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
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.
@yf225 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Can we split aten function to |
|
@jerryzh168 Yes I think that would be beneficial - the C++ API implementation here is just strictly following Python API implementation, and we can change it once the Python implementation is changed. |
Add torch::nn::BatchNorm{2,3}d module and functional support for the C++ API.
Related Issue: #25883 #28176
Reviewer: @yf225