What shape does X_train have?
I’ve tested it with different shapes and am not sure, which function throws this error:
def tempsigmoid(x):
    nd=3.0 
    temp=nd/torch.log(torch.tensor(9.0)) 
    return torch.sigmoid(x/(temp)) 

tempsigmoid(torch.randn(1))
tempsigmoid(torch.tensor(1.))
tempsigmoid(torch.randn(1, 1))