Added documentation for get_layout API (#13937)

* Added documentation for get_layout API

* Fixed typo
This commit is contained in:
Ilya Churaev
2022-11-10 19:10:07 +04:00
committed by GitHub
parent cf34d48e53
commit 63e24773ee
3 changed files with 55 additions and 1 deletions

View File

@@ -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;
}