Skip to content

Commit

Permalink
use torch.jit.Final instead of Final for beit, eva
Browse files Browse the repository at this point in the history
  • Loading branch information
rwightman committed May 12, 2023
1 parent 35b9fc7 commit f744bda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions timm/models/beit.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
# --------------------------------------------------------'

import math
from functools import partial
from typing import Callable, Final, Optional, Tuple, Union
from typing import Callable, Optional, Tuple, Union

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


class Attention(nn.Module):
fused_attn: Final[bool]
fused_attn: torch.jit.Final[bool]

def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions timm/models/eva.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# EVA02 models Copyright (c) 2023 BAAI-Vision

import math
from typing import Callable, Final, Optional, Tuple, Union
from typing import Callable, Optional, Tuple, Union

import torch
import torch.nn as nn
Expand All @@ -45,7 +45,7 @@


class EvaAttention(nn.Module):
fused_attn: Final[bool]
fused_attn: torch.jit.Final[bool]

def __init__(
self,
Expand Down

0 comments on commit f744bda

Please sign in to comment.