Suppose following simple model:
class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.linear1 = nn.Linear(10, 10)
        self.linear2 = nn.Linear(10, 2)

    def forward(self, x):
        x = linear1(x)
        x = linear2(x)
        return x

you can add nn.LogSigmoid() 121 layer to get sigmoid(x):
class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.linear1 = nn.Linear(10, 10)
        self.linear2 = nn.Linear(10, 2)
        self.sigmoid = nn.Sigmoid()

    def forward(self, x):
        x = linear1(x)
        x = linear2(x)
        x = sigmoid(x)
        return x

If you use binary cross entropy loss, you can compute loss as:
model = Net()
y = model.forward(input)
loss = - t*log(y) - (1-t)*log(1-y) 


postscript
Modified the LogSigmoid to Sigmoid