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
f03ca0f9
Unverified
Commit
f03ca0f9
authored
Jan 27, 2022
by
Vasilis Vryniotis
Committed by
GitHub
Jan 27, 2022
Browse files
Switch torch.quantization to torch.ao.quantization (#5296)
parent
693a4632
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchvision/prototype/models/quantization/mobilenetv3.py
torchvision/prototype/models/quantization/mobilenetv3.py
+3
-3
No files found.
torchvision/prototype/models/quantization/mobilenetv3.py
View file @
f03ca0f9
...
@@ -43,14 +43,14 @@ def _mobilenet_v3_model(
...
@@ -43,14 +43,14 @@ def _mobilenet_v3_model(
if
quantize
:
if
quantize
:
model
.
fuse_model
()
model
.
fuse_model
()
model
.
qconfig
=
torch
.
quantization
.
get_default_qat_qconfig
(
backend
)
model
.
qconfig
=
torch
.
ao
.
quantization
.
get_default_qat_qconfig
(
backend
)
torch
.
quantization
.
prepare_qat
(
model
,
inplace
=
True
)
torch
.
ao
.
quantization
.
prepare_qat
(
model
,
inplace
=
True
)
if
weights
is
not
None
:
if
weights
is
not
None
:
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
if
quantize
:
if
quantize
:
torch
.
quantization
.
convert
(
model
,
inplace
=
True
)
torch
.
ao
.
quantization
.
convert
(
model
,
inplace
=
True
)
model
.
eval
()
model
.
eval
()
return
model
return
model
...
...
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