We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 86f7957 + 531be32 commit 77643d4Copy full SHA for 77643d4
art/attacks/evasion/adversarial_patch/adversarial_patch_pytorch.py
@@ -683,7 +683,10 @@ def apply_patch(
683
mask = mask.copy()
684
mask = self._check_mask(mask=mask, x=x)
685
x_tensor = torch.Tensor(x)
686
- mask_tensor = torch.Tensor(mask)
+ if mask is not None:
687
+ mask_tensor = torch.Tensor(mask)
688
+ else:
689
+ mask_tensor = None
690
if isinstance(patch_external, np.ndarray):
691
patch_tensor = torch.Tensor(patch_external)
692
else:
0 commit comments