Theseus: A Library for Differentiable Nonlinear Optimization