Hi, I’m working on creating a C++ extension for a customized depthwise convolution layer on CPU. Besides all the parameters used in at::Tensor _convolution() in pytorch/pytorch/blob/master/aten/src/ATen/native/Convolution.cpp, I have another input which is a mask in the same shape of input channel (const Tensor& mask). I met couple of problems when implementing this new convolution extension:
- Although I have used namespace at and native as used in pytorch/pytorch/blob/master/aten/src/ATen/native/Convolution.cpp, I’m still facing the problem : error: no type named ‘IntArrayRef’ in namespace ‘at’ May I ask where is this IntArrayRef defined?
- I was not be able to use the dispatch as what the source code did at pytorch/pytorch/blob/master/aten/src/ATen/native/Convolution.cpp line 21: DEFINE_DISPATCH(convolution_depthwise3x3_winograd_stub);
The reason I’m using it is because I also want to call convolution_depthwise3x3_winograd_stub();
- This may sounds like a silly one, my convolution is executed based on the zeros and ones in my mask, so I was trying to use if-statements. It seems I was not be able to do some comparisons like:
if (mask[i] == 0) or if (mask[i] == torch::zeros(shape)), it will return an error of error: value of type ‘at::Tensor’ is not contextually convertible to ‘bool’. May I ask how should I do it?