Skip to content

Commit 7f4a210

Browse files
committed
update NS for FX tutorial for PyTorch v1.13
Summary: Makes a couple of updates to ensure this tutorial still runs on 1.13: 1. changes the `qconfig_dict` argument of `prepare_fx` to `qconfig_mapping` 2. adds `example_inputs` to `prepare_fx` Test plan: Run the tutorial, it runs without errors on master
1 parent 7d8cb43 commit 7f4a210

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prototype_source/fx_numeric_suite_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ def plot(xdata, ydata, xlabel, ylabel, title):
8484
# Note: quantization APIs are inplace, so we save a copy of the float model for
8585
# later comparison to the quantized model. This is done throughout the
8686
# tutorial.
87-
mobilenetv2_prepared = quantize_fx.prepare_fx(
88-
copy.deepcopy(mobilenetv2_float), qconfig_dict)
8987
datum = torch.randn(1, 3, 224, 224)
88+
mobilenetv2_prepared = quantize_fx.prepare_fx(
89+
copy.deepcopy(mobilenetv2_float), qconfig_dict, (datum,))
9090
mobilenetv2_prepared(datum)
9191
# Note: there is a long standing issue that we cannot copy.deepcopy a
9292
# quantized model. Since quantization APIs are inplace and we need to use

0 commit comments

Comments
 (0)