MCPcopy Index your code
hub / github.com/MoonInTheRiver/DiffSinger / _training_step

Method _training_step

usr/task.py:56–61  ·  view source on GitHub ↗
(self, sample, batch_idx, _)

Source from the content-addressed store, hash-verified

54 return losses, output
55
56 def _training_step(self, sample, batch_idx, _):
57 log_outputs = self.run_model(self.model, sample)
58 total_loss = sum([v for v in log_outputs.values() if isinstance(v, torch.Tensor) and v.requires_grad])
59 log_outputs['batch_size'] = sample['txt_tokens'].size()[0]
60 log_outputs['lr'] = self.scheduler.get_lr()[0]
61 return total_loss, log_outputs
62
63 def validation_step(self, sample, batch_idx):
64 outputs = {}

Callers

nothing calls this directly

Calls 3

run_modelMethod · 0.95
sizeMethod · 0.80
get_lrMethod · 0.80

Tested by

no test coverage detected