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 15, 2024
1 parent 63b8ddb commit 31d92e8
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 @@ -2967,8 +2967,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 31d92e8

Please sign in to comment.