update AUTO Debug doc with snippets (#11117)

Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>
This commit is contained in:
Yuan Hu 2022-03-23 16:31:03 +08:00 committed by GitHub
parent eb74afe417
commit af874e7754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 31 deletions

View File

@ -13,38 +13,18 @@ There are six levels of logs, which can be called explicitly or set via the `OPE
5 - ov::log::Level::TRACE
@sphinxdirective
.. tab:: C++ API
.. code-block:: cpp
.. tab:: C++
ov::Core core;
.. doxygensnippet:: docs/snippets/AUTO6.cpp
:language: cpp
:fragment: [part6]
.. tab:: Python
// read a network in IR, PaddlePaddle, or ONNX format
std::shared_ptr<ov::Model> model = core.read_model("sample.xml");
// load a network to AUTO and set log level to debug
ov::CompiledModel compiled_model = core.compile_model(model, "AUTO", {{ov::log::level.name(), "LOG_DEBUG"}});
// or set log level with set_config and load network
core.set_property("AUTO", {{ov::log::level.name(), "LOG_DEBUG"}});
ov::CompiledModel compiled_model2 = core.compile_model(model, "AUTO");
.. tab:: Python API
.. code-block:: python
from openvino.runtime import Core
core = Core()
# read a network in IR, PaddlePaddle, or ONNX format
model = core.read_model(model_path)
# load a network to AUTO and set log level to debug
compiled_model = core.compile_model(model=model, device_name="AUTO", config={"LOG_LEVEL":"LOG_DEBUG"});
// or set log level with set_config and load network
ie.SetConfig(config={"LOG_LEVEL":"LOG_DEBUG"}, device_name="AUTO");
compiled_model = core.compile_model(model=model, device_name="AUTO");
.. doxygensnippet:: docs/snippets/ov_auto.py
:language: python
:fragment: [part6]
.. tab:: OS environment variable

View File

@ -8,10 +8,10 @@ ov::Core core;
// read a network in IR, PaddlePaddle, or ONNX format
std::shared_ptr<ov::Model> model = core.read_model("sample.xml");
// load a network to AUTO and set log level to debug
// compile a model on AUTO and set log level to debug
ov::CompiledModel compiled_model = core.compile_model(model, "AUTO", ov::log::level(ov::log::Level::DEBUG));
// or set log level with set_config and load network
// or set log level with set_property and compile model
core.set_property("AUTO", ov::log::level(ov::log::Level::DEBUG));
ov::CompiledModel compiled_model2 = core.compile_model(model, "AUTO");
//! [part6]

View File

@ -94,12 +94,25 @@ def part5():
compiled_model = core.compile_model(model=model, device_name="AUTO")
#! [part5]
def part6():
#! [part6]
core = Core()
# read a network in IR, PaddlePaddle, or ONNX format
model = core.read_model(model_path)
# compile a model on AUTO and set log level to debug
compiled_model = core.compile_model(model=model, device_name="AUTO", config={"LOG_LEVEL":"LOG_DEBUG"});
# set log level with set_property and compile model
core.set_property(device_name="AUTO", properties={"LOG_LEVEL":"LOG_DEBUG"});
compiled_model = core.compile_model(model=model, device_name="AUTO");
#! [part6]
def main():
part0()
part1()
part3()
part4()
part5()
part6()
if __name__ == '__main__':
sys.exit(main())