Replace build() with build_in_name_scope() for some TF tests (#28046)

Replace build() with build_in_name_scope() for some tests
This commit is contained in:
Matt
2023-12-14 17:42:25 +00:00
committed by GitHub
parent 050e0b44f6
commit 3060899be5
4 changed files with 10 additions and 10 deletions

View File

@@ -225,7 +225,7 @@ class TFCTRLModelTest(TFModelTesterMixin, PipelineTesterMixin, unittest.TestCase
for model_class in self.all_model_classes:
model = model_class(config)
model.build() # may be needed for the get_bias() call below
model.build_in_name_scope() # may be needed for the get_bias() call below
assert isinstance(model.get_input_embeddings(), tf.keras.layers.Layer)
if model_class in list_lm_models: