NaN values while going with other form of Sigmoid

I’ve tried to implement sigmoid function with it’s altered form. Why i’m facing NaN values in the first case?

Image -(Showing torch.exp(x)/1+torch.exp(x))

Probably an issue with the inputs. Have randomised the inputs and used the sigmoid as you have. Works perfectly fine.