Skip to content

Commit

Permalink
Remove **kwargs from prepare_optimizer
Browse files Browse the repository at this point in the history
Summary:
None of the optimizer classes accept **kwargs, so I am removing **kwargs from perpare_optimizer.

Otherwsie, the current code throws an error when creating a custom PrivacyEngine that takes in additional arguments.

Differential Revision: D67456352
  • Loading branch information
iden-kalemaj authored and facebook-github-bot committed Dec 19, 2024
1 parent 144bd2a commit 23850b2
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions opacus/privacy_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def _prepare_optimizer(
clipping: str = "flat",
noise_generator=None,
grad_sample_mode="hooks",
**kwargs,
) -> DPOptimizer:
if isinstance(optimizer, DPOptimizer):
optimizer = optimizer.original_optimizer
Expand All @@ -136,7 +135,6 @@ def _prepare_optimizer(
loss_reduction=loss_reduction,
generator=generator,
secure_mode=self.secure_mode,
**kwargs,
)

def _prepare_data_loader(
Expand Down Expand Up @@ -396,7 +394,6 @@ def make_private(
distributed=distributed,
clipping=clipping,
grad_sample_mode=grad_sample_mode,
**kwargs,
)

optimizer.attach_step_hook(
Expand Down

0 comments on commit 23850b2

Please sign in to comment.