Skip to content

Commit

Permalink
Add error for invalid state outputs type in trainer
Browse files Browse the repository at this point in the history
  • Loading branch information
JAEarly committed Jan 18, 2024
1 parent a2de08f commit b945c5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion composer/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2990,8 +2990,10 @@ def _eval_loop(
outputs.append(v.cpu())
else:
outputs.append(v)
else:
elif isinstance(self.state.outputs, torch.Tensor):
outputs = self.state.outputs.cpu()
else:
raise ValueError('Unsupported type for state.outputs in trainer eval loop.')
else:
outputs = self.state.outputs

Expand Down

0 comments on commit b945c5a

Please sign in to comment.