Closed tczhangzhi closed 6 years ago
I have solved the problem. This seems to be a problem caused by CUDAExtension not recognizing the passing of references in CPP files during compilation. So we just have to pass variants by value.
// before fix
at::Tensor sigmoid_cuda_forward(
const at::Tensor& input);
// after fix
at::Tensor sigmoid_cuda_forward(
at::Tensor input);
// other code ...
OS: 16.04 PyTorch version: 0.4.1 How you installed PyTorch (conda, pip, source): conda Python version: 3.6 CUDA/cuDNN version: 9.0 GPU models and configuration: Tesla K80
I define my own custom opt:
And the cpp wrapper is as follow:
The compilation process is successful.
But when I import it, things will go wrong.