From da4b3825f0ed64b7398ace00c5062503811d0cff Mon Sep 17 00:00:00 2001 From: Patrick Labatut Date: Fri, 27 Oct 2023 07:33:32 -0700 Subject: [PATCH] Lint --- dinov2/utils/param_groups.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dinov2/utils/param_groups.py b/dinov2/utils/param_groups.py index 72545547f..9a5d2ff62 100644 --- a/dinov2/utils/param_groups.py +++ b/dinov2/utils/param_groups.py @@ -22,10 +22,20 @@ def get_vit_lr_decay_rate(name, lr_decay_rate=1.0, num_layers=12, force_is_backb """ layer_id = num_layers + 1 if name.startswith("backbone") or force_is_backbone: - if ".pos_embed" in name or ".patch_embed" in name or ".mask_token" in name or ".cls_token" in name or ".register_tokens" in name: + if ( + ".pos_embed" in name + or ".patch_embed" in name + or ".mask_token" in name + or ".cls_token" in name + or ".register_tokens" in name + ): layer_id = 0 elif force_is_backbone and ( - "pos_embed" in name or "patch_embed" in name or "mask_token" in name or "cls_token" in name or "register_tokens" in name + "pos_embed" in name + or "patch_embed" in name + or "mask_token" in name + or "cls_token" in name + or "register_tokens" in name ): layer_id = 0 elif ".blocks." in name and ".residual." not in name: