Updated documentation for serialize model (#14022)
This commit is contained in:
parent
47b6155013
commit
6da7ee3431
@ -7,7 +7,6 @@
|
||||
#include <openvino/opsets/opset8.hpp>
|
||||
// ! [ov:include]
|
||||
|
||||
#include <openvino/pass/serialize.hpp>
|
||||
#include <openvino/pass/visualize_tree.hpp>
|
||||
#include <openvino/openvino.hpp>
|
||||
#include <openvino/opsets/opset8.hpp>
|
||||
@ -80,16 +79,8 @@ void ov_api_examples() {
|
||||
}
|
||||
|
||||
// ! [ov:serialize]
|
||||
void serialize_example(const std::shared_ptr<ov::Model>& f) {
|
||||
// Need include:
|
||||
// * openvino/pass/manager.hpp
|
||||
// * openvino/pass/serialize.hpp
|
||||
ov::pass::Manager manager;
|
||||
|
||||
// Serialize ov::Model to IR
|
||||
manager.register_pass<ov::pass::Serialize>("/path/to/file/model.xml", "/path/to/file/model.bin");
|
||||
|
||||
manager.run_passes(f);
|
||||
void serialize_example(const std::shared_ptr<ov::Model>& model) {
|
||||
ov::serialize(model, "/path/to/file/model.xml", "/path/to/file/model.bin");
|
||||
}
|
||||
// ! [ov:serialize]
|
||||
|
||||
|
@ -59,11 +59,8 @@ def ov_api_examples():
|
||||
|
||||
# ! [ov:serialize]
|
||||
def serialize_example(m : ov.Model):
|
||||
# Need import:
|
||||
# * import openvino.runtime.passes as passes
|
||||
pass_manager = passes.Manager()
|
||||
pass_manager.register_pass(pass_name="Serialize", xml_path='model.xml', bin_path='model.bin')
|
||||
pass_manager.run_passes(m)
|
||||
from openvino.runtime import serialize
|
||||
serialize(m, xml_path='model.xml', bin_path='model.bin')
|
||||
# ! [ov:serialize]
|
||||
|
||||
# ! [ov:visualize]
|
||||
|
Loading…
Reference in New Issue
Block a user