Skip to content

Commit

Permalink
Add MPS support for list outputs in training eval loop
Browse files Browse the repository at this point in the history
  • Loading branch information
JAEarly committed Jan 18, 2024
1 parent 09dbe18 commit a2de08f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions composer/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2983,6 +2983,13 @@ def _eval_loop(
outputs[k] = v.cpu()
else:
outputs[k] = v
elif isinstance(self.state.outputs, Sequence):
outputs = []
for v in self.state.outputs:
if isinstance(v, torch.Tensor):
outputs.append(v.cpu())
else:
outputs.append(v)
else:
outputs = self.state.outputs.cpu()
else:
Expand Down

0 comments on commit a2de08f

Please sign in to comment.