Skip to content

Commit f744bda

Browse files
committed
use torch.jit.Final instead of Final for beit, eva
1 parent 35b9fc7 commit f744bda

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

timm/models/beit.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
# --------------------------------------------------------'
4040

4141
import math
42-
from functools import partial
43-
from typing import Callable, Final, Optional, Tuple, Union
42+
from typing import Callable, Optional, Tuple, Union
4443

4544
import torch
4645
import torch.nn as nn
@@ -80,7 +79,7 @@ def gen_relative_position_index(window_size: Tuple[int, int]) -> torch.Tensor:
8079

8180

8281
class Attention(nn.Module):
83-
fused_attn: Final[bool]
82+
fused_attn: torch.jit.Final[bool]
8483

8584
def __init__(
8685
self,

timm/models/eva.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# EVA02 models Copyright (c) 2023 BAAI-Vision
2727

2828
import math
29-
from typing import Callable, Final, Optional, Tuple, Union
29+
from typing import Callable, Optional, Tuple, Union
3030

3131
import torch
3232
import torch.nn as nn
@@ -45,7 +45,7 @@
4545

4646

4747
class EvaAttention(nn.Module):
48-
fused_attn: Final[bool]
48+
fused_attn: torch.jit.Final[bool]
4949

5050
def __init__(
5151
self,

0 commit comments

Comments
 (0)