diff --git a/docs/optimization_guide/nncf/ptq/code/ptq_onnx.py b/docs/optimization_guide/nncf/ptq/code/ptq_onnx.py index fa9d1e35734d14..b8104d449c566f 100644 --- a/docs/optimization_guide/nncf/ptq/code/ptq_onnx.py +++ b/docs/optimization_guide/nncf/ptq/code/ptq_onnx.py @@ -16,7 +16,8 @@ def transform_fn(data_item): #! [dataset] #! [quantization] -model = ... # onnx.ModelProto object +import onnx +model = onnx.load("model_path") quantized_model = nncf.quantize(model, calibration_dataset) #! [quantization] diff --git a/docs/optimization_guide/nncf/ptq/code/ptq_openvino.py b/docs/optimization_guide/nncf/ptq/code/ptq_openvino.py index eb2f89edf36098..81e19fd99f5c8b 100644 --- a/docs/optimization_guide/nncf/ptq/code/ptq_openvino.py +++ b/docs/optimization_guide/nncf/ptq/code/ptq_openvino.py @@ -15,14 +15,13 @@ def transform_fn(data_item): #! [dataset] #! [quantization] -model = ... # openvino.runtime.Model object +import openvino.runtime as ov +model = ov.Core().read_model("model_path") quantized_model = nncf.quantize(model, calibration_dataset) #! [quantization] #! [inference] -import openvino.runtime as ov - # compile the model to transform quantized operations to int8 model_int8 = ov.compile_model(quantized_model) diff --git a/docs/optimization_guide/nncf/ptq/code/ptq_tensorflow.py b/docs/optimization_guide/nncf/ptq/code/ptq_tensorflow.py index fcb29c8741e5da..e4fc817ddb31d8 100644 --- a/docs/optimization_guide/nncf/ptq/code/ptq_tensorflow.py +++ b/docs/optimization_guide/nncf/ptq/code/ptq_tensorflow.py @@ -15,7 +15,8 @@ def transform_fn(data_item): #! [dataset] #! [quantization] -model = ... # tensorflow.Module object +import tensorflow as tf +model = tf.saved_model.load("model_path") quantized_model = nncf.quantize(model, calibration_dataset) #! [quantization] diff --git a/docs/optimization_guide/nncf/ptq/code/ptq_torch.py b/docs/optimization_guide/nncf/ptq/code/ptq_torch.py index a65f0998622042..fbdf103b4f2bf9 100644 --- a/docs/optimization_guide/nncf/ptq/code/ptq_torch.py +++ b/docs/optimization_guide/nncf/ptq/code/ptq_torch.py @@ -15,7 +15,8 @@ def transform_fn(data_item): #! [dataset] #! [quantization] -model = ... # torch.nn.Module object +import torchvision +model = torchvision.models.resnet50(pretrained=True) quantized_model = nncf.quantize(model, calibration_dataset) #! [quantization]