Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Improving code snippets for quantization #19479

3 changes: 2 additions & 1 deletion docs/optimization_guide/nncf/ptq/code/ptq_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def transform_fn(data_item):
#! [dataset]

#! [quantization]
model = ... # onnx.ModelProto object
import onnx
model = onnx.ModelProto() # onnx.ModelProto object
sgolebiewski-intel marked this conversation as resolved.
Show resolved Hide resolved

quantized_model = nncf.quantize(model, calibration_dataset)
#! [quantization]
Expand Down
3 changes: 2 additions & 1 deletion docs/optimization_guide/nncf/ptq/code/ptq_openvino.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def transform_fn(data_item):
#! [dataset]

#! [quantization]
model = ... # openvino.runtime.Model object
import openvino as ov
model = ov.Model() # openvino.runtime.Model object
sgolebiewski-intel marked this conversation as resolved.
Show resolved Hide resolved

quantized_model = nncf.quantize(model, calibration_dataset)
#! [quantization]
Expand Down
3 changes: 2 additions & 1 deletion docs/optimization_guide/nncf/ptq/code/ptq_tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def transform_fn(data_item):
#! [dataset]

#! [quantization]
model = ... # tensorflow.Module object
import tensorflow as tf
model = tf.Module() # tensorflow.Module object
sgolebiewski-intel marked this conversation as resolved.
Show resolved Hide resolved

quantized_model = nncf.quantize(model, calibration_dataset)
#! [quantization]
Expand Down
3 changes: 2 additions & 1 deletion docs/optimization_guide/nncf/ptq/code/ptq_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def transform_fn(data_item):
#! [dataset]

#! [quantization]
model = ... # torch.nn.Module object
import torch.nn as nn
model = nn.Module() # torch.nn.Module object
sgolebiewski-intel marked this conversation as resolved.
Show resolved Hide resolved
sgolebiewski-intel marked this conversation as resolved.
Show resolved Hide resolved

quantized_model = nncf.quantize(model, calibration_dataset)
#! [quantization]
Expand Down