Harry24k / adversarial-attacks-pytorch

PyTorch implementation of adversarial attacks [torchattacks]
https://adversarial-attacks-pytorch.readthedocs.io/en/latest/index.html
MIT License
1.86k stars 348 forks source link

[advice] use __class__.__name__ #115

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 1 year ago

https://github.com/Harry24k/adversarial-attacks-pytorch/blob/master/torchattacks/attack.py#L68

        self.model_name = str(model).split("(")[0]

is same as

        self.model_name = model.__class__.__name__
Harry24k commented 1 year ago

Thank you for your advice! I fixed it : https://github.com/Harry24k/adversarial-attacks-pytorch/commit/fdb62912ce3bd19f3139e0277b5b3d27c8cdeea8