Skip to content

Commit

Permalink
build in name scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed Dec 7, 2023
1 parent 25550fb commit a130cbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/models/opt/test_modeling_tf_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _get_word_embedding_weight(model, embedding_layer):
else:
# Here we build the word embeddings weights if not exists.
# And then we retry to get the attribute once built.
model.build()
model.build_in_name_scope()
if hasattr(embedding_layer, "weight"):
return embedding_layer.weight
else:
Expand Down

0 comments on commit a130cbc

Please sign in to comment.