Apply ruff flake8-comprehensions (#21694)
This commit is contained in:
@@ -628,7 +628,7 @@ class TFGroupViTModelTest(TFModelTesterMixin, unittest.TestCase):
|
||||
if self.__class__.__name__ == "TFGroupViTModelTest":
|
||||
inputs_dict.pop("return_loss", None)
|
||||
|
||||
tf_main_layer_classes = set(
|
||||
tf_main_layer_classes = {
|
||||
module_member
|
||||
for model_class in self.all_model_classes
|
||||
for module in (import_module(model_class.__module__),)
|
||||
@@ -640,7 +640,7 @@ class TFGroupViTModelTest(TFModelTesterMixin, unittest.TestCase):
|
||||
if isinstance(module_member, type)
|
||||
and tf.keras.layers.Layer in module_member.__bases__
|
||||
and getattr(module_member, "_keras_serializable", False)
|
||||
)
|
||||
}
|
||||
for main_layer_class in tf_main_layer_classes:
|
||||
# T5MainLayer needs an embed_tokens parameter when called without the inputs_embeds parameter
|
||||
if "T5" in main_layer_class.__name__:
|
||||
|
||||
Reference in New Issue
Block a user