Layout

Overview

OpenVINO Layout API to work and configure layouts for ov::Model inputs or outputs More…

// classes

class ov::Layout;

// global functions

OPENVINO_API bool ov::layout::has_batch(const Layout& layout);
OPENVINO_API std::int64_t ov::layout::batch_idx(const Layout& layout);
OPENVINO_API bool ov::layout::has_channels(const Layout& layout);
OPENVINO_API std::int64_t ov::layout::channels_idx(const Layout& layout);
OPENVINO_API bool ov::layout::has_depth(const Layout& layout);
OPENVINO_API std::int64_t ov::layout::depth_idx(const Layout& layout);
OPENVINO_API bool ov::layout::has_height(const Layout& layout);
OPENVINO_API std::int64_t ov::layout::height_idx(const Layout& layout);
OPENVINO_API bool ov::layout::has_width(const Layout& layout);
OPENVINO_API std::int64_t ov::layout::width_idx(const Layout& layout);

OPENVINO_API void ov::layout::set_layout(
    ov::Output<ov::Node> output,
    const ov::Layout& layout
    );

OPENVINO_API ov::Layout ov::layout::get_layout(const ov::Output<ov::Node>& output);
OPENVINO_API ov::Layout ov::layout::get_layout(const ov::Output<const ov::Node>& output);

Detailed Documentation

OpenVINO Layout API to work and configure layouts for ov::Model inputs or outputs

Global Functions

OPENVINO_API bool ov::layout::has_batch(const Layout& layout)

Checks if layout has ‘batch’ dimension.

OPENVINO_API std::int64_t ov::layout::batch_idx(const Layout& layout)

Returns ‘batch’ dimension index.

Parameters:

ov::AssertFailure

if dimension doesn’t exist.

OPENVINO_API bool ov::layout::has_channels(const Layout& layout)

Checks if layout has ‘channels’ dimension.

Parameters:

ov::AssertFailure

if dimension doesn’t exist.

OPENVINO_API std::int64_t ov::layout::channels_idx(const Layout& layout)

Returns ‘channels’ dimension index.

Parameters:

ov::AssertFailure

if dimension doesn’t exist.

OPENVINO_API bool ov::layout::has_depth(const Layout& layout)

Checks if layout has ‘depth’ dimension.

OPENVINO_API std::int64_t ov::layout::depth_idx(const Layout& layout)

Returns ‘depth’ dimension index.

Parameters:

ov::AssertFailure

if dimension doesn’t exist.

OPENVINO_API bool ov::layout::has_height(const Layout& layout)

Checks if layout has ‘height’ dimension.

OPENVINO_API std::int64_t ov::layout::height_idx(const Layout& layout)

Returns ‘height’ dimension index.

Parameters:

ov::AssertFailure

if dimension doesn’t exist.

OPENVINO_API bool ov::layout::has_width(const Layout& layout)

Checks if layout has ‘width’ dimension.

OPENVINO_API std::int64_t ov::layout::width_idx(const Layout& layout)

Returns ‘width’ dimension index.

Parameters:

ov::AssertFailure

if dimension doesn’t exist.

OPENVINO_API void ov::layout::set_layout(
    ov::Output<ov::Node> output,
    const ov::Layout& layout
    )

Sets Layout of port.

Parameters:

ov::Exception

if port is not connected with Result or Parameter

OPENVINO_API ov::Layout ov::layout::get_layout(const ov::Output<ov::Node>& output)

Gets Layout of port.

Returns:

layout from port and empty layout in other case

OPENVINO_API ov::Layout ov::layout::get_layout(const ov::Output<const ov::Node>& output)

Gets Layout of port.

Returns:

layout from port and empty layout in other case