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
30cb4e10
Unverified
Commit
30cb4e10
authored
Oct 28, 2019
by
Francisco Massa
Committed by
GitHub
Oct 28, 2019
Browse files
Remove model download from test_quantized_models (#1526)
parent
b4cb5765
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
test/test_quantized_models.py
test/test_quantized_models.py
+4
-6
No files found.
test/test_quantized_models.py
View file @
30cb4e10
...
...
@@ -48,16 +48,14 @@ class ModelTester(TestCase):
self
.
assertTrue
(
scriptable
,
msg
)
def
_test_classification_model
(
self
,
name
,
input_shape
):
# passing num_class equal to a number other than 1000 helps in making the test
# more enforcing in nature
# First check if quantize=True provides models that can run with input data
model
=
torchvision
.
models
.
quantization
.
__dict__
[
name
](
pretrained
=
Tru
e
,
quantize
=
True
)
model
=
torchvision
.
models
.
quantization
.
__dict__
[
name
](
pretrained
=
Fals
e
,
quantize
=
True
)
self
.
check_quantized_model
(
model
,
input_shape
)
for
eval
in
[
True
,
False
]:
for
eval
_mode
in
[
True
,
False
]:
model
=
torchvision
.
models
.
quantization
.
__dict__
[
name
](
pretrained
=
False
,
quantize
=
False
)
if
eval
:
if
eval
_mode
:
model
.
eval
()
model
.
qconfig
=
torch
.
quantization
.
default_qconfig
else
:
...
...
@@ -65,7 +63,7 @@ class ModelTester(TestCase):
model
.
qconfig
=
torch
.
quantization
.
default_qat_qconfig
model
.
fuse_model
()
if
eval
:
if
eval
_mode
:
torch
.
quantization
.
prepare
(
model
,
inplace
=
True
)
else
:
torch
.
quantization
.
prepare_qat
(
model
,
inplace
=
True
)
...
...
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