autograd functions (sigmoid here) lock either inputs or output tensors, a bit arbitrarily (as sigmoid is invertible, one can store either tensor). Here I think that simpler derivative formula was the deciding factor to choose to store output.