Skip to content

Commit

Permalink
Return the permuted hidden states if return_dict=True (huggingface#18578
Browse files Browse the repository at this point in the history
)
  • Loading branch information
amyeroberts committed Aug 17, 2022
1 parent 5d1df72 commit f03866f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/models/convnext/modeling_tf_convnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ def call(
hidden_states = tuple([tf.transpose(h, perm=(0, 3, 1, 2)) for h in encoder_outputs[1]])

if not return_dict:
return (last_hidden_state, pooled_output) + encoder_outputs[1:]
hidden_states = hidden_states if output_hidden_states else ()
return (last_hidden_state, pooled_output) + hidden_states

return TFBaseModelOutputWithPooling(
last_hidden_state=last_hidden_state,
Expand Down

0 comments on commit f03866f

Please sign in to comment.