-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Port avg_pool3d() to ATen #21732
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
Port avg_pool3d() to ATen #21732
Conversation
|
@ezyang I think this one is ready now. I've kept the existing frame functions but did not create new ones. The existing Also, |
Sounds like an omission; nice catch :) |
| TORCH_INTERNAL_ASSERT(kernel_size.size() == 3 && | ||
| (stride.empty() || stride.size() == 3) && | ||
| (padding.size() == 1 || padding.size() == 3), | ||
| "avg_pool3d: all IntArrayRef sizes must be 3"); |
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.
Huh, do we actually check this from the C++ frontend? If not, this probably should be a CHECK.
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.
ezyang
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.
Nifty!
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.
@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
This couldn't be landed due to internal issues. I am taking a look. |
Summary: This will need a conflict resolution once avg_pool2d() has been merged. Pull Request resolved: pytorch/pytorch#21732 Differential Revision: D15824923 Pulled By: ezyang fbshipit-source-id: 83341e0209b660aecf788272079d8135d78b6ff1
|
Oof, we should really fix this in the C++ frontend somehow. I guess we
can bandaid it for now by adding logic to replicate in each operator
individually...
Excerpts from Stefan Krah's message of 2019-06-21 11:54:45 -0700:
… skrah commented on this pull request.
> +
+void avg_pool3d_out_cpu_template(
+ Tensor& output,
+ const Tensor& input_,
+ IntArrayRef kernel_size,
+ IntArrayRef stride,
+ IntArrayRef padding,
+ bool ceil_mode,
+ bool count_include_pad)
+{
+ // #20866 [JIT] stride.empty() is passed through
+ // #20866 [LIBTORCH] IntegrationTest.MNIST: padding.size() == 1
+ TORCH_INTERNAL_ASSERT(kernel_size.size() == 3 &&
+ (stride.empty() || stride.size() == 3) &&
+ (padding.size() == 1 || padding.size() == 3),
+ "avg_pool3d: all IntArrayRef sizes must be 3");
@ezyang Good question, it actually came up now in #22032, which showed that people are using the C++ frontend like the Python functions (expecting that single integers are repeated automatically).
So it's a CHECK now (#22075).
|
This will need a conflict resolution once avg_pool2d() has been merged.