diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7333d8890..638305ff9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: hooks: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/cheshirekow/cmake-format-precommit diff --git a/bindings/python/proxsuite/torch/qplayer.py b/bindings/python/proxsuite/torch/qplayer.py index 52d9fbda6..ae4e26a5d 100644 --- a/bindings/python/proxsuite/torch/qplayer.py +++ b/bindings/python/proxsuite/torch/qplayer.py @@ -414,9 +414,9 @@ def backward(ctx, dl_dzhat, dl_dlams, dl_dnus, dl_ds_e, dl_ds_i): if neq > 0: kkt[:dim, dim : dim + n_eq] = A_i.transpose() kkt[dim : dim + n_eq, :dim] = A_i - kkt[ - dim + n_eq + n_in : dim + 2 * n_eq + n_in, dim : dim + n_eq - ] = -np.eye(n_eq) + kkt[dim + n_eq + n_in : dim + 2 * n_eq + n_in, dim : dim + n_eq] = ( + -np.eye(n_eq) + ) kkt[ dim + n_eq + n_in : dim + 2 * n_eq + n_in, dim + n_eq + 2 * n_in : 2 * dim + n_eq + 2 * n_in, @@ -444,9 +444,9 @@ def backward(ctx, dl_dzhat, dl_dlams, dl_dnus, dl_ds_e, dl_ds_i): dim_ = 0 if n_eq > 0: dim_ += dim - kkt[ - dim + 2 * n_eq + n_in :, dim + n_eq + 2 * n_in + dim_ : - ] = np.multiply(np.diag(D_2_c)[:, None], C_i) + kkt[dim + 2 * n_eq + n_in :, dim + n_eq + 2 * n_in + dim_ :] = ( + np.multiply(np.diag(D_2_c)[:, None], C_i) + ) rhs = np.zeros(kkt.shape[0]) rhs[:dim] = -dl_dzhat[i]