MCPcopy
hub / github.com/NVlabs/stylegan / update

Method update

dnnlib/submission/run_context.py:61–72  ·  view source on GitHub ↗

Do general housekeeping and keep the state of the context up-to-date. Should be called often enough but not in a tight loop.

(self, loss: Any = 0, cur_epoch: Any = 0, max_epoch: Any = None)

Source from the content-addressed store, hash-verified

59 self.close()
60
61 def update(self, loss: Any = 0, cur_epoch: Any = 0, max_epoch: Any = None) -> None:
62 """Do general housekeeping and keep the state of the context up-to-date.
63 Should be called often enough but not in a tight loop."""
64 assert not self.has_closed
65
66 self.last_update_interval = time.time() - self.last_update_time
67 self.last_update_time = time.time()
68
69 if os.path.exists(os.path.join(self.submit_config.run_dir, "abort.txt")):
70 self.should_stop_flag = True
71
72 max_epoch_val = self.max_epoch if max_epoch is None else max_epoch
73
74 def should_stop(self) -> bool:
75 """Tell whether a stopping condition has been triggered one way or another."""

Callers 10

run_all_snapshotsFunction · 0.95
training_loopFunction · 0.95
mainFunction · 0.80
_init_graphMethod · 0.80
get_output_forMethod · 0.80
cloneMethod · 0.80
convertMethod · 0.80
_sanitize_tf_configFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected