Skip to content

Commit 56c3a84

Browse files
authored
Update type hint for register_notrace_module
register_notrace_module is used to decorate types (i.e. subclasses of nn.Module). It is not called on module instances.
1 parent d7b55a9 commit 56c3a84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

timm/models/fx_features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" PyTorch FX Based Feature Extraction Helpers
22
Using https://pytorch.org/vision/stable/feature_extraction.html
33
"""
4-
from typing import Callable, List, Dict, Union
4+
from typing import Callable, List, Dict, Union, Type
55

66
import torch
77
from torch import nn
@@ -35,7 +35,7 @@
3535
pass
3636

3737

38-
def register_notrace_module(module: nn.Module):
38+
def register_notrace_module(module: Type[nn.Module]):
3939
"""
4040
Any module not under timm.models.layers should get this decorator if we don't want to trace through it.
4141
"""

0 commit comments

Comments
 (0)