MCPcopy Create free account
hub / github.com/NarcissusEx/GuardSplat / __init__

Method __init__

attack_utils.py:128–134  ·  view source on GitHub ↗
(self, attack_types, flag=True)

Source from the content-addressed store, hash-verified

126
127class Attacker(nn.Module):
128 def __init__(self, attack_types, flag=True):
129 super().__init__()
130 for attack_type in filter(lambda x : x != 'JPEGCompress', attack_types):
131 setattr(self, attack_type, globals()[f'{attack_type}Attack']())
132
133 if 'JPEGCompress' in attack_types:
134 self.JPEGCompress = JPEGCompressAttack(flag)
135
136 def forward(self, image, attack_type):
137 return getattr(self, attack_type)(image)

Callers 9

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

JPEGCompressAttackClass · 0.85

Tested by

no test coverage detected