MCPcopy Create free account
hub / github.com/ali-vilab/ACE_plus / run_eval

Method run_eval

modules/ace_plus_solver.py:19–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17
18 @torch.no_grad()
19 def run_eval(self):
20 self.eval_mode()
21 self.before_all_iter(self.hooks_dict[self._mode])
22 all_results = []
23 for batch_idx, batch_data in tqdm(
24 enumerate(self.datas[self._mode].dataloader)):
25 self.before_iter(self.hooks_dict[self._mode])
26 if self.sample_args:
27 batch_data.update(self.sample_args.get_lowercase_dict())
28 with torch.autocast(device_type='cuda',
29 enabled=self.use_amp,
30 dtype=self.dtype):
31 results = self.run_step_eval(transfer_data_to_cuda(batch_data),
32 batch_idx,
33 step=self.total_iter,
34 rank=we.rank)
35 all_results.extend(results)
36 self.after_iter(self.hooks_dict[self._mode])
37 log_data, log_label = self.save_results(all_results)
38 self.register_probe({'eval_label': log_label})
39 self.register_probe({
40 'eval_image':
41 ProbeData(log_data,
42 is_image=True,
43 build_html=True,
44 build_label=log_label)
45 })
46 self.after_all_iter(self.hooks_dict[self._mode])
47
48 @torch.no_grad()
49 def run_test(self):

Callers 1

run_taskFunction · 0.80

Calls 2

save_resultsMethod · 0.95
after_iterMethod · 0.45

Tested by

no test coverage detected