mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 11:11:05 +06:00
Fix add order (#9129)
This commit is contained in:
parent
18ecd36f65
commit
e771749777
@ -623,9 +623,9 @@ class TFTransfoXLMainLayer(tf.keras.layers.Layer):
|
||||
core_out = tf.transpose(core_out, perm=(1, 0, 2))
|
||||
|
||||
if inputs["output_hidden_states"]:
|
||||
# Add last layer and transpose to library standard shape [bsz, len, hidden_dim]
|
||||
hids.append(core_out)
|
||||
# Transpose to library standard shape [bsz, len, hidden_dim] and add last layer
|
||||
hids = tuple(tf.transpose(t, perm=(1, 0, 2)) for t in hids)
|
||||
hids = hids + (core_out,)
|
||||
else:
|
||||
hids = None
|
||||
if inputs["output_attentions"]:
|
||||
|
Loading…
Reference in New Issue
Block a user