Skip to content

Conversation

@ifedan
Copy link
Contributor

@ifedan ifedan commented May 10, 2019

Stack:
    :black_circle:  #20370 conv2d implmentation for LongTensor  💛

  • enable generation of conv2d for LongTensor

Differential Revision: D15192353

Differential Revision: D15192353
Differential Version: 81513072
@pytorchbot pytorchbot added module: cpu CPU specific problem (e.g., perf, algorithm) module: internals Related to internal abstractions in c10 and ATen module: operators labels May 10, 2019
@ifedan ifedan requested a review from gchanan May 10, 2019 18:04
@ifedan
Copy link
Contributor Author

ifedan commented May 10, 2019

Comment on CR for #20105:
@gchanan:
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.
@gchanan:
I don't think this makes sense to implement AvgPool 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?

Differential Revision: D15192353
Differential Version: 81532976
@pytorchbot pytorchbot added the module: nn Related to torch.nn label May 10, 2019
@fmassa
Copy link
Member

fmassa commented May 10, 2019

About @gchanan comment on AvgPool for Long: I think it should be implemented. Bilinear / bicubic interpolation on integer types (uint8 for example) are widely used, and I don't think that AvgPool is that different from a bilinear downsampling.

@gchanan
Copy link
Contributor

gchanan commented May 13, 2019

@fmassa do any of those have division on integer dtypes? From what I can tell, those only have division in backwards, and we don't support backwards on integer dtypes anyway.

My naive interpretation would be AvgPool would actually return a non-integer dtype on integer dtype inputs, but we don't have (many) cross-dtype operations yet.

Thoughts?

@fmassa
Copy link
Member

fmassa commented May 13, 2019

@gchanan interpolate multiplies the values of the to be interpolated by a floating point value, so this is the same situation as in here. Note that our interpolate kernels do not support integer types yet, but I think they should. Interpolation for integer types is implemented in opencv and Pillow through, and I can grab some examples once I'm back to my computer

@fmassa
Copy link
Member

fmassa commented May 13, 2019

But you do bring valid points though. Im not sure if we should stick with what is currently done in image processing libs, or adopt a more numpy-correct alternative

Differential Revision: D15192353
Differential Version: 81880367
@ifedan ifedan changed the title conv2d implmentation for LongTensor Functions: conv2d, sum_pool2d for LongTensor May 15, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ifedan has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ifedan
Copy link
Contributor Author

ifedan commented May 16, 2019

@pytorchbot retest this please

@ifedan ifedan closed this May 20, 2019
@ezyang ezyang deleted the export-D15192353 branch May 30, 2019 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: cpu CPU specific problem (e.g., perf, algorithm) module: internals Related to internal abstractions in c10 and ATen module: nn Related to torch.nn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants