MCPcopy Create free account
hub / github.com/ChenWu98/agent-attack / init

Method init

agent_attack/attacks/clip_attack.py:265–269  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

263 model.device = torch.device(f"cuda:{num_gpus - 1 - i // models_each_gpu}")
264
265 def init(self):
266 # set the model parameters requires_grad is False
267 for model in self.models:
268 model.requires_grad_(False)
269 model.eval()
270
271 def to(self, device: torch.device):
272 for model in self.models:

Callers 3

__init__Method · 0.95
eval_step.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected