Many elementwise operations, especially traditional mathematical ones, are in the torch namespace (so torch.log(var) or var.log() here). If they don’t give an error when applied to a Variable, they’re differentiable. In general you don’t need to instantiate modules like Softplus; the versions in nn are provided to make it easier to use nn.Sequential and all parameterless modules in nn have a simpler functional equivalent in F.