-
Notifications
You must be signed in to change notification settings - Fork 26.3k
conv2d / avg_pool2d implmentation for LongTensor #20105
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
5c94fca to
1335a39
Compare
Summary: - enable generation of conv2d for LongTensor - enable generation of avg_pool2d for LongTensor Differential Revision: D15192353 fbshipit-source-id: fb293ca7fd647a20b1f8ded11c70b59af93937d4
gchanan
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.
testing? It also seems like you don't support a larger number of cases, e.g. depthwise, transposed, dilated convolutions.
Maybe similar on the AvgPool / SumPool too, but I'm not sure.
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.
instead of doing this, can you just include Long manually where you need it?
i.e.
#include "whatever"
#include "THGenerateFloatTypes.h"
#include "whatever
#include "THGenerateLongType.h"
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.
Fixed: #20370
aten/src/THC/THCBlas.cu
Outdated
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.
we shouldn't define this if it's not supported (and won't be in the near future). Just throw an error in the implementation.
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.
Fixed: #20370
| scalar_check: | ||
| output: 'false' | ||
| grad_input: 'false' | ||
| scalar_types: ['Float', 'Double', 'Half', 'Long'] |
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.
can we support cpu_scalar_types and cuda_scalar_types since we don't actually support conv2d for longs on CUDA anyway?
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.
Added implementation: #20370
| bool ceil_mode, | ||
| bool count_include_pad); | ||
|
|
||
| THC_API void THNN_(SpatialAveragePooling_updateGradInput)( |
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.
I don't think these backward definitions (updateGradInput, accGradParameters) make sense for integer types.
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.
Fixed: #20370
| int padW, int padH, | ||
| accreal scale); | ||
|
|
||
| TH_API void THNN_(SpatialAveragePooling_updateOutput)( |
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.
I don't think this makes sense to implement for long because of the integer division (i.e. we don't support long on mean). Doesn't it make sense to implement SumPool instead?
|
There is another PR: #20370 that will track this FR. This one will be closed |
Summary:
Differential Revision: D15192353