(self, recursive=True)
| 163 | self.search_method.filter_transformations = self.filter_transformations |
| 164 | |
| 165 | def clear_cache(self, recursive=True): |
| 166 | self.constraints_cache.clear() |
| 167 | if self.use_transformation_cache: |
| 168 | self.transformation_cache.clear() |
| 169 | if recursive: |
| 170 | self.goal_function.clear_cache() |
| 171 | for constraint in self.constraints: |
| 172 | if hasattr(constraint, "clear_cache"): |
| 173 | constraint.clear_cache() |
| 174 | |
| 175 | def cpu_(self): |
| 176 | """Move any `torch.nn.Module` models that are part of Attack to CPU.""" |