Added documentation for get_layout API (#13937)
* Added documentation for get_layout API * Fixed typo
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include <openvino/core/layout.hpp>
|
||||
#include "openvino/core/layout.hpp"
|
||||
#include "openvino/core/model.hpp"
|
||||
|
||||
int main() {
|
||||
ov::Layout layout;
|
||||
@@ -54,5 +55,13 @@ layout = ov::Layout("NCHW");
|
||||
std::cout << layout.to_string(); // prints [N,C,H,W]
|
||||
//! [ov:layout:dump]
|
||||
|
||||
std::shared_ptr<ov::Model> model;
|
||||
//! [ov:layout:get_from_model]
|
||||
// Get layout for model input
|
||||
layout = ov::layout::get_layout(model->input("input_tensor_name"));
|
||||
// Get layout for model with single output
|
||||
layout = ov::layout::get_layout(model->output());
|
||||
//! [ov:layout:get_from_model]
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user