pytorch / opacus

Training PyTorch models with differential privacy
https://opacus.ai
Apache License 2.0
1.67k stars 332 forks source link

Make DPMultiheadAttention drop-in compatible with nn.MultiheadAttention #528

Closed Wei-1 closed 1 year ago

Wei-1 commented 1 year ago

Types of changes

Motivation and Context / Related issue

This PR is target to resolve #123 by having an additional re-naming mechanism to match the state_dict structure of nn.MultiheadAttention.

How Has This Been Tested (if it applies)

Run pytest within the opacus folder:

============= 162 passed, 41 skipped, 4411 warnings in 243.18s (0:04:03) =============

Checklist

Wei-1 commented 1 year ago

Remove for duplicated PR