MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / _training_step

Method _training_step

tasks/tts/fs2.py:75–79  ·  view source on GitHub ↗
(self, sample, batch_idx, _)

Source from the content-addressed store, hash-verified

73 return self.model
74
75 def _training_step(self, sample, batch_idx, _):
76 loss_output = self.run_model(self.model, sample)
77 total_loss = sum([v for v in loss_output.values() if isinstance(v, torch.Tensor) and v.requires_grad])
78 loss_output['batch_size'] = sample['txt_tokens'].size()[0]
79 return total_loss, loss_output
80
81 def validation_step(self, sample, batch_idx):
82 outputs = {}

Callers

nothing calls this directly

Calls 2

run_modelMethod · 0.95
sizeMethod · 0.80

Tested by

no test coverage detected