update AUTO Debug doc with snippets (#11117)
Signed-off-by: Hu, Yuan2 <yuan2.hu@intel.com>
This commit is contained in:
parent
eb74afe417
commit
af874e7754
@ -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
|
5 - ov::log::Level::TRACE
|
||||||
|
|
||||||
@sphinxdirective
|
@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
|
.. doxygensnippet:: docs/snippets/ov_auto.py
|
||||||
std::shared_ptr<ov::Model> model = core.read_model("sample.xml");
|
:language: python
|
||||||
|
:fragment: [part6]
|
||||||
// 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");
|
|
||||||
|
|
||||||
.. tab:: OS environment variable
|
.. tab:: OS environment variable
|
||||||
|
|
||||||
|
@ -8,10 +8,10 @@ ov::Core core;
|
|||||||
// read a network in IR, PaddlePaddle, or ONNX format
|
// read a network in IR, PaddlePaddle, or ONNX format
|
||||||
std::shared_ptr<ov::Model> model = core.read_model("sample.xml");
|
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));
|
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));
|
core.set_property("AUTO", ov::log::level(ov::log::Level::DEBUG));
|
||||||
ov::CompiledModel compiled_model2 = core.compile_model(model, "AUTO");
|
ov::CompiledModel compiled_model2 = core.compile_model(model, "AUTO");
|
||||||
//! [part6]
|
//! [part6]
|
||||||
|
@ -94,12 +94,25 @@ def part5():
|
|||||||
compiled_model = core.compile_model(model=model, device_name="AUTO")
|
compiled_model = core.compile_model(model=model, device_name="AUTO")
|
||||||
#! [part5]
|
#! [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():
|
def main():
|
||||||
part0()
|
part0()
|
||||||
part1()
|
part1()
|
||||||
part3()
|
part3()
|
||||||
part4()
|
part4()
|
||||||
part5()
|
part5()
|
||||||
|
part6()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
Loading…
Reference in New Issue
Block a user