Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
183a7221
Unverified
Commit
183a7221
authored
Jun 22, 2021
by
Nicolas Hug
Committed by
GitHub
Jun 22, 2021
Browse files
[FBcode->GH] Group all internally replaced utils into a single file (#4095)
parent
d391a0e9
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
11 additions
and
18 deletions
+11
-18
torchvision/models/quantization/inception.py
torchvision/models/quantization/inception.py
+1
-1
torchvision/models/quantization/mobilenetv2.py
torchvision/models/quantization/mobilenetv2.py
+1
-1
torchvision/models/quantization/mobilenetv3.py
torchvision/models/quantization/mobilenetv3.py
+1
-1
torchvision/models/quantization/resnet.py
torchvision/models/quantization/resnet.py
+1
-1
torchvision/models/quantization/shufflenetv2.py
torchvision/models/quantization/shufflenetv2.py
+1
-1
torchvision/models/resnet.py
torchvision/models/resnet.py
+1
-1
torchvision/models/segmentation/segmentation.py
torchvision/models/segmentation/segmentation.py
+1
-1
torchvision/models/shufflenetv2.py
torchvision/models/shufflenetv2.py
+1
-1
torchvision/models/squeezenet.py
torchvision/models/squeezenet.py
+1
-1
torchvision/models/utils.py
torchvision/models/utils.py
+0
-7
torchvision/models/vgg.py
torchvision/models/vgg.py
+1
-1
torchvision/models/video/resnet.py
torchvision/models/video/resnet.py
+1
-1
No files found.
torchvision/models/quantization/inception.py
View file @
183a7221
...
@@ -5,7 +5,7 @@ import torch.nn as nn
...
@@ -5,7 +5,7 @@ import torch.nn as nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
torchvision.models
import
inception
as
inception_module
from
torchvision.models
import
inception
as
inception_module
from
torchvision.models.inception
import
InceptionOutputs
from
torchvision.models.inception
import
InceptionOutputs
from
torchvision.models.
utils
import
load_state_dict_from_url
from
..._internally_replaced_
utils
import
load_state_dict_from_url
from
.utils
import
_replace_relu
,
quantize_model
from
.utils
import
_replace_relu
,
quantize_model
...
...
torchvision/models/quantization/mobilenetv2.py
View file @
183a7221
from
torch
import
nn
from
torch
import
nn
from
torchvision.models.
utils
import
load_state_dict_from_url
from
..._internally_replaced_
utils
import
load_state_dict_from_url
from
torchvision.models.mobilenetv2
import
InvertedResidual
,
ConvBNReLU
,
MobileNetV2
,
model_urls
from
torchvision.models.mobilenetv2
import
InvertedResidual
,
ConvBNReLU
,
MobileNetV2
,
model_urls
from
torch.quantization
import
QuantStub
,
DeQuantStub
,
fuse_modules
from
torch.quantization
import
QuantStub
,
DeQuantStub
,
fuse_modules
from
.utils
import
_replace_relu
,
quantize_model
from
.utils
import
_replace_relu
,
quantize_model
...
...
torchvision/models/quantization/mobilenetv3.py
View file @
183a7221
import
torch
import
torch
from
torch
import
nn
,
Tensor
from
torch
import
nn
,
Tensor
from
torchvision.models.
utils
import
load_state_dict_from_url
from
..._internally_replaced_
utils
import
load_state_dict_from_url
from
torchvision.models.mobilenetv3
import
InvertedResidual
,
InvertedResidualConfig
,
ConvBNActivation
,
MobileNetV3
,
\
from
torchvision.models.mobilenetv3
import
InvertedResidual
,
InvertedResidualConfig
,
ConvBNActivation
,
MobileNetV3
,
\
SqueezeExcitation
,
model_urls
,
_mobilenet_v3_conf
SqueezeExcitation
,
model_urls
,
_mobilenet_v3_conf
from
torch.quantization
import
QuantStub
,
DeQuantStub
,
fuse_modules
from
torch.quantization
import
QuantStub
,
DeQuantStub
,
fuse_modules
...
...
torchvision/models/quantization/resnet.py
View file @
183a7221
import
torch
import
torch
from
torchvision.models.resnet
import
Bottleneck
,
BasicBlock
,
ResNet
,
model_urls
from
torchvision.models.resnet
import
Bottleneck
,
BasicBlock
,
ResNet
,
model_urls
import
torch.nn
as
nn
import
torch.nn
as
nn
from
torchvision.models.
utils
import
load_state_dict_from_url
from
..._internally_replaced_
utils
import
load_state_dict_from_url
from
torch.quantization
import
fuse_modules
from
torch.quantization
import
fuse_modules
from
.utils
import
_replace_relu
,
quantize_model
from
.utils
import
_replace_relu
,
quantize_model
...
...
torchvision/models/quantization/shufflenetv2.py
View file @
183a7221
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
torchvision.models.
utils
import
load_state_dict_from_url
from
..._internally_replaced_
utils
import
load_state_dict_from_url
import
torchvision.models.shufflenetv2
import
torchvision.models.shufflenetv2
import
sys
import
sys
from
.utils
import
_replace_relu
,
quantize_model
from
.utils
import
_replace_relu
,
quantize_model
...
...
torchvision/models/resnet.py
View file @
183a7221
import
torch
import
torch
from
torch
import
Tensor
from
torch
import
Tensor
import
torch.nn
as
nn
import
torch.nn
as
nn
from
.utils
import
load_state_dict_from_url
from
.
._internally_replaced_
utils
import
load_state_dict_from_url
from
typing
import
Type
,
Any
,
Callable
,
Union
,
List
,
Optional
from
typing
import
Type
,
Any
,
Callable
,
Union
,
List
,
Optional
...
...
torchvision/models/segmentation/segmentation.py
View file @
183a7221
from
.._utils
import
IntermediateLayerGetter
from
.._utils
import
IntermediateLayerGetter
from
..utils
import
load_state_dict_from_url
from
..
._internally_replaced_
utils
import
load_state_dict_from_url
from
..
import
mobilenetv3
from
..
import
mobilenetv3
from
..
import
resnet
from
..
import
resnet
from
.deeplabv3
import
DeepLabHead
,
DeepLabV3
from
.deeplabv3
import
DeepLabHead
,
DeepLabV3
...
...
torchvision/models/shufflenetv2.py
View file @
183a7221
import
torch
import
torch
from
torch
import
Tensor
from
torch
import
Tensor
import
torch.nn
as
nn
import
torch.nn
as
nn
from
.utils
import
load_state_dict_from_url
from
.
._internally_replaced_
utils
import
load_state_dict_from_url
from
typing
import
Callable
,
Any
,
List
from
typing
import
Callable
,
Any
,
List
...
...
torchvision/models/squeezenet.py
View file @
183a7221
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
import
torch.nn.init
as
init
import
torch.nn.init
as
init
from
.utils
import
load_state_dict_from_url
from
.
._internally_replaced_
utils
import
load_state_dict_from_url
from
typing
import
Any
from
typing
import
Any
__all__
=
[
'SqueezeNet'
,
'squeezenet1_0'
,
'squeezenet1_1'
]
__all__
=
[
'SqueezeNet'
,
'squeezenet1_0'
,
'squeezenet1_1'
]
...
...
torchvision/models/utils.py
deleted
100644 → 0
View file @
d391a0e9
# Don't remove this file and don't change the imports of load_state_dict_from_url
# from other files. We need this so that we can swap load_state_dict_from_url with
# a custom internal version in fbcode.
try
:
from
torch.hub
import
load_state_dict_from_url
except
ImportError
:
from
torch.utils.model_zoo
import
load_url
as
load_state_dict_from_url
torchvision/models/vgg.py
View file @
183a7221
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
.utils
import
load_state_dict_from_url
from
.
._internally_replaced_
utils
import
load_state_dict_from_url
from
typing
import
Union
,
List
,
Dict
,
Any
,
cast
from
typing
import
Union
,
List
,
Dict
,
Any
,
cast
...
...
torchvision/models/video/resnet.py
View file @
183a7221
import
torch.nn
as
nn
import
torch.nn
as
nn
from
..utils
import
load_state_dict_from_url
from
..
._internally_replaced_
utils
import
load_state_dict_from_url
__all__
=
[
'r3d_18'
,
'mc3_18'
,
'r2plus1d_18'
]
__all__
=
[
'r3d_18'
,
'mc3_18'
,
'r2plus1d_18'
]
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment