From 242a7fb76dbbc499d1fd363175ae47bb700371b3 Mon Sep 17 00:00:00 2001 From: Songhao Jia Date: Mon, 30 Mar 2026 10:59:18 -0700 Subject: [PATCH] solve et lint-mypy issue (#18587) Summary: try to solve lint-mypy issue in torch.hud Differential Revision: D98762153 --- backends/arm/test/models/Gemma3n/gemma3n_test_config.py | 4 ++-- backends/arm/test/models/phi3/phi3_module_test_configs.py | 2 +- .../stable_diffusion_module_test_configs.py | 4 ++-- backends/arm/test/modules/test_static_cache.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backends/arm/test/models/Gemma3n/gemma3n_test_config.py b/backends/arm/test/models/Gemma3n/gemma3n_test_config.py index 4bd3e413307..f2c3291d655 100644 --- a/backends/arm/test/models/Gemma3n/gemma3n_test_config.py +++ b/backends/arm/test/models/Gemma3n/gemma3n_test_config.py @@ -23,7 +23,7 @@ def get_gemma3n_text_test_config() -> Gemma3nTextConfig: altup_num_inputs=4, altup_active_idx=0, altup_correct_scale=True, - ) + ) # type: ignore[call-arg] # Force eager attention path to keep the module exportable in tests. config._attn_implementation = "eager" return config @@ -34,4 +34,4 @@ def get_gemma3n_audio_test_config() -> Gemma3nAudioConfig: input_feat_size=128, hidden_size=256, rms_norm_eps=1e-6, - ) + ) # type: ignore[call-arg] diff --git a/backends/arm/test/models/phi3/phi3_module_test_configs.py b/backends/arm/test/models/phi3/phi3_module_test_configs.py index d2b8c01fc30..0422b5f3871 100644 --- a/backends/arm/test/models/phi3/phi3_module_test_configs.py +++ b/backends/arm/test/models/phi3/phi3_module_test_configs.py @@ -18,7 +18,7 @@ def get_phi3_test_config() -> Phi3Config: original_max_position_embeddings=32, use_cache=False, tie_word_embeddings=False, - ) + ) # type: ignore[call-arg] # Force eager attention path to keep the module exportable in tests. config._attn_implementation = "eager" return config diff --git a/backends/arm/test/models/stable_diffusion/stable_diffusion_module_test_configs.py b/backends/arm/test/models/stable_diffusion/stable_diffusion_module_test_configs.py index 89f6e7c13ed..d1cdd17d377 100644 --- a/backends/arm/test/models/stable_diffusion/stable_diffusion_module_test_configs.py +++ b/backends/arm/test/models/stable_diffusion/stable_diffusion_module_test_configs.py @@ -34,7 +34,7 @@ # Source: https://github.com/huggingface/diffusers/blob/v0.33.1/tests/pipelines/stable_diffusion_3/test_pipeline_stable_diffusion_3.py#L56 -CLIP_text_encoder_config = CLIPTextConfig( +CLIP_text_encoder_config = CLIPTextConfig( # type: ignore[call-arg] bos_token_id=0, eos_token_id=2, hidden_size=32, @@ -51,7 +51,7 @@ # Source: https://github.com/huggingface/diffusers/blob/v0.33.1/tests/pipelines/stable_diffusion_3/test_pipeline_stable_diffusion_3.py#L76 # Exported from: T5EncoderModel.from_pretrained("hf-internal-testing/tiny-random-t5").config -T5_encoder_config = T5Config( +T5_encoder_config = T5Config( # type: ignore[call-arg] bos_token_id=0, classifier_dropout=0.0, d_ff=37, diff --git a/backends/arm/test/modules/test_static_cache.py b/backends/arm/test/modules/test_static_cache.py index 72904fedda6..c371dedcb69 100644 --- a/backends/arm/test/modules/test_static_cache.py +++ b/backends/arm/test/modules/test_static_cache.py @@ -28,11 +28,11 @@ test_configs = { - "multihead_attention": LlamaConfig(num_attention_heads=32), - "grouped_query_attention": LlamaConfig( + "multihead_attention": LlamaConfig(num_attention_heads=32), # type: ignore[call-arg] + "grouped_query_attention": LlamaConfig( # type: ignore[call-arg] num_attention_heads=32, num_key_value_heads=4 ), - "multi_query_attention": LlamaConfig(num_attention_heads=32, num_key_value_heads=1), + "multi_query_attention": LlamaConfig(num_attention_heads=32, num_key_value_heads=1), # type: ignore[call-arg] }