Commit f09f42d4 authored by Lysandre's avatar Lysandre
Browse files

Input Embeddings should be assigned

cc @julien-c
parent bac51fba
...@@ -756,7 +756,7 @@ class XLNetModel(XLNetPreTrainedModel): ...@@ -756,7 +756,7 @@ class XLNetModel(XLNetPreTrainedModel):
input_ids = input_ids.transpose(0, 1).contiguous() input_ids = input_ids.transpose(0, 1).contiguous()
qlen, bsz = input_ids.shape[0], input_ids.shape[1] qlen, bsz = input_ids.shape[0], input_ids.shape[1]
elif inputs_embeds is not None: elif inputs_embeds is not None:
inputs_embeds.transpose(0, 1).contiguous() inputs_embeds = inputs_embeds.transpose(0, 1).contiguous()
qlen, bsz = inputs_embeds.shape[0], inputs_embeds.shape[1] qlen, bsz = inputs_embeds.shape[0], inputs_embeds.shape[1]
else: else:
raise ValueError("You have to specify either input_ids or inputs_embeds") raise ValueError("You have to specify either input_ids or inputs_embeds")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment