Skip to content

Commit

Permalink
fix: outputs may be tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
Achazwl authored Dec 15, 2022
1 parent 10d192c commit 1074c8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bmtrain/block_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def forward(ctx, placeholder, block : 'CheckpointBlock', preserve_rng_state, len

if not isinstance(outputs, list) and not isinstance(outputs, tuple):
outputs = [outputs]
else:
outputs = list(outputs)
return tuple([len(outputs)] + outputs + [hidden_state["tensor"] for hidden_state in inspector.hidden_states])

@staticmethod
Expand Down

0 comments on commit 1074c8a

Please sign in to comment.