From fca6748246c3387de0801bc3acb042c8ae013694 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Fri, 6 Jun 2025 10:47:10 +0200 Subject: [PATCH] Improve `test_initialization` for `SwiftFormer` (#38636) * fix * fix --------- Co-authored-by: ydshieh --- tests/models/swiftformer/test_modeling_swiftformer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/models/swiftformer/test_modeling_swiftformer.py b/tests/models/swiftformer/test_modeling_swiftformer.py index 35b678952d..7302c47127 100644 --- a/tests/models/swiftformer/test_modeling_swiftformer.py +++ b/tests/models/swiftformer/test_modeling_swiftformer.py @@ -250,6 +250,8 @@ class SwiftFormerModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestC for model_class in self.all_model_classes: model = model_class(config=configs_no_init) for name, param in model.named_parameters(): + if name.endswith(".w_g"): + continue if param.requires_grad: self.assertIn( ((param.data.mean() * 1e9) / 1e9).round().item(),