* [DOCS][CPU] Added sparse weights decompression feature description * sparsity documentation fix * fixed code snippet names * moved code snippets into cpu folder * review changes * review fixes 2 * review fixes 3 * code style fix * small fix
16 lines
504 B
Python
16 lines
504 B
Python
# Copyright (C) 2022 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
import openvino.runtime as ov
|
|
|
|
device_name = 'CPU'
|
|
xml_path = 'model.xml'
|
|
# ! [ov:intel_cpu:sparse_weights_decompression:part0]
|
|
core = ov.Core()
|
|
core.set_property("CPU", ov.properties.intel_cpu.sparse_weights_decompression_rate(0.8))
|
|
model = core.read_model(model=xml_path)
|
|
compiled_model = core.compile_model(model=model, device_name=device_name)
|
|
# ! [ov:intel_cpu:sparse_weights_decompression:part0]
|
|
assert compiled_model
|