We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a0434d commit 3756b60Copy full SHA for 3756b60
torchvision/models/_utils.py
@@ -2,7 +2,7 @@
2
3
import torch
4
from torch import nn
5
-from torch.jit.annotations import Dict
+from typing import Dict
6
7
8
class IntermediateLayerGetter(nn.ModuleDict):
@@ -41,7 +41,7 @@ class IntermediateLayerGetter(nn.ModuleDict):
41
"return_layers": Dict[str, str],
42
}
43
44
- def __init__(self, model, return_layers):
+ def __init__(self, model: nn.Module, return_layers: Dict[str, str]):
45
if not set(return_layers).issubset([name for name, _ in model.named_children()]):
46
raise ValueError("return_layers are not present in model")
47
orig_return_layers = return_layers
0 commit comments