Hi Frank!
Thank you for your answer! Yes, I also checked that the result of my module is the same as the library. But for some reason, with my sigmoid module, the network is not trained. I still can’t figure out why  maybe in torch.nn.Sigmoid somehow works with gradients in a special way… idk