MCPcopy
hub / github.com/hpcaitech/ColossalAI / check_frequency

Method check_frequency

examples/images/diffusion/main.py:500–509  ·  view source on GitHub ↗
(self, check_idx)

Source from the content-addressed store, hash-verified

498
499 # The function checks if it's time to log an image batch
500 def check_frequency(self, check_idx):
501 if ((check_idx % self.batch_freq) == 0 or (check_idx in self.log_steps)) and (
502 check_idx > 0 or self.log_first_step
503 ):
504 try:
505 self.log_steps.pop(0)
506 except IndexError as e:
507 print(e)
508 return True
509 return False
510
511 # Log images on train batch end if logging is not disabled
512 def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx):

Callers 1

log_imgMethod · 0.95

Calls 1

popMethod · 0.45

Tested by

no test coverage detected