Softplus without Variable

Traceback (most recent call last):
File “”, line 1, in
RuntimeError: softplus(): argument ‘input’ (position 1) must be Variable, not torch.FloatTensor

Why softplus doesn’t work without Variable(…) wrapper?
Doesn’t torch.nn.functional.softplus(Variable(tensor)).data seem ugly?

Pytorch versions: 0.3.0.post4, 0.2.0.post4’

nn.funtional are supposed to work with torch Variable not the plain Tensor. Ref here.

So the only way out at the moment is to use F.softplus(Variable(x)).data until Variable and Tensor will be merged, because torch.log(torch.exp(x) + 1) is not as numerically stable as F.softplus?

I suppose so. Or you can find the source code of softplus and see how it is implemented.

Variable and Tensor will be merged into one class in near future.