Skip to content

Commit

Permalink
Fix return outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
erogol committed Feb 25, 2022
1 parent 424d04e commit 14c1179
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TTS/tts/models/vits.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ def train_step(self, batch: dict, criterion: nn.Module, optimizer_idx: int) -> T
scores_disc_real,
scores_disc_fake,
)
return {}, loss_dict
return outputs, loss_dict

if optimizer_idx == 1:
mel = batch["mel"]
Expand Down
4 changes: 3 additions & 1 deletion tests/tts_tests/test_vits.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,9 @@ def test_train_step(self):
for _ in range(5):
batch = self._create_batch(config, 2)
for idx in [0, 1]:
_, loss_dict = model.train_step(batch, criterions, idx)
outputs, loss_dict = model.train_step(batch, criterions, idx)
self.assertFalse(not outputs)
self.assertFalse(not loss_dict)
loss_dict["loss"].backward()
optimizers[idx].step()
optimizers[idx].zero_grad()
Expand Down

0 comments on commit 14c1179

Please sign in to comment.