Oh…

comparing the output of the sigmoid to  0.5  is equivalent to comparing the input of the sigmoid to  0

Yes, thank you for your suggestion 
But why


get  value of loss  by  output data

get  value of accuracy  by  torch.sigmoid( output data )



is the right way for getting value of loss and accuracy? 
We should get both loss and accuracy by the same data, isn’t it right?