functorch icon indicating copy to clipboard operation
functorch copied to clipboard

Forward auto differentiation not implemented for torch softplus nonlinearity

Open lrast opened this issue 2 years ago • 1 comments

Found using functorch.hessian and in a model with a torch.nn.Softplus() nonlinearity. Error message:

NotImplementedError: Trying to use forward AD with softplus_backward that does not support it.

Writing the nonlinearity by hand fixed the issue. Reporting as requested

lrast avatar Jun 08 '22 19:06 lrast

Thanks for reporting, @lrast. I assume that you're using PyTorch 1.11 and functorch 0.1.*.

This problem should be fixed in the pytorch nightly + functorch main branch. If you're interested in trying that out, please see the instructions over at https://github.com/pytorch/functorch#installing-functorch-from-source .

zou3519 avatar Jun 08 '22 20:06 zou3519