Skip to content

Commit

Permalink
Fix timm version compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Cathy0908 committed Oct 26, 2023
1 parent 6b1abd2 commit e04ce3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion easycv/models/backbones/efficientformer.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Copyright (c) 2022 Snap Inc. All rights reserved.
import itertools
import os
from distutils.version import LooseVersion

import torch
import torch.nn as nn
from timm.models.layers import DropPath, trunc_normal_
from timm.models.layers.helpers import to_2tuple

from ..modelzoo import efficientformer as model_urls
from ..registry import BACKBONES

if LooseVersion(torch.__version__) <= LooseVersion('0.8.2'):
from timm.models.layers.helpers import to_2tuple
else:
from timm.layers.helpers import to_2tuple


class Attention(torch.nn.Module):

Expand Down

0 comments on commit e04ce3c

Please sign in to comment.