NotImplementedError when using _backend.SpatialFullConvolution in latest pytorch

For my code, I need to access _backend.SpatialFullConvolution_updateOutput, when I use it in an earlier version of PyTorch it works fine but in the newer version (‘1.3.0.dev20190814’) I get the following error:

File “/conda-envs/pytorch_tensorflow/lib/python3.6/site-packages/torch/_thnn/”, line 27, in __ getattr __
raise NotImplementedError

Is this behavior expected?


what do you use it for?


I am trying to access backward path parameters e.g. weights, like what is used for here:

I was wondering if there is a substitute for this backend in the new version?


I’m not 100% sure what your code is doing, but it looks like you could probably use a backward hook to achieve the same effect. “SpatialConvolutionMM” is the same as “thnn_conv2d” I believe.

Thanks for your reply.
backward hook only gives me the gradients computed in each layer. I want to be able to write my backward function which does not assume backpropagation (symmetric weight). That’s why access to _backend.SpatialConvolutionMM_updateGradInput
is important for my code. I would like to have access to such a function in the new Pytorch if it is possible.

we don’t expose a function that does that anymore to Python. It’s still available in C++ (though not guaranteed to continue to exist), should be thnn_backward.

I’d probably just write your own version for this case, though, if this is the only updateGradInput variant you need.

1 Like