Group Partial Shape#

group ov_partial_shape_c_api

The definitions & operations about partial shape.

Functions

ov_partial_shape_create(const int64_t rank, const ov_dimension_t *dims, ov_partial_shape_t *partial_shape_obj)#

Initialze a partial shape with static rank and dynamic dimension.

Parameters:
  • rank – support static rank.

  • dims – support dynamic and static dimension. Static rank, but dynamic dimensions on some or all axes. Examples: {1,2,?,4} or {?,?,?} or {1,2,-1,4} Static rank, and static dimensions on all axes. Examples: {1,2,3,4} or {6} or {}

Returns:

Status code of the operation: OK(0) for success.

ov_partial_shape_create_dynamic(const ov_rank_t rank, const ov_dimension_t *dims, ov_partial_shape_t *partial_shape_obj)#

Initialze a partial shape with dynamic rank and dynamic dimension.

Parameters:
  • rank – support dynamic and static rank.

  • dims – support dynamic and static dimension. Dynamic rank: Example: ? Static rank, but dynamic dimensions on some or all axes. Examples: {1,2,?,4} or {?,?,?} or {1,2,-1,4} Static rank, and static dimensions on all axes. Examples: {1,2,3,4} or {6} or {}"

Returns:

Status code of the operation: OK(0) for success.

ov_partial_shape_create_static(const int64_t rank, const int64_t *dims, ov_partial_shape_t *partial_shape_obj)#

Initialize a partial shape with static rank and static dimension.

Parameters:
  • rank – support static rank.

  • dims – support static dimension. Static rank, and static dimensions on all axes. Examples: {1,2,3,4} or {6} or {}

Returns:

Status code of the operation: OK(0) for success.

ov_partial_shape_free(ov_partial_shape_t *partial_shape)#

Release internal memory allocated in partial shape.

Parameters:

partial_shape – The object’s internal memory will be released.

Returns:

Status code of the operation: OK(0) for success.

ov_partial_shape_to_shape(const ov_partial_shape_t partial_shape, ov_shape_t *shape)#

Convert partial shape without dynamic data to a static shape.

Parameters:
  • partial_shape – The partial_shape pointer.

  • shape – The shape pointer.

Returns:

Status code of the operation: OK(0) for success.

ov_shape_to_partial_shape(const ov_shape_t shape, ov_partial_shape_t *partial_shape)#

Convert shape to partial shape.

Parameters:
  • shape – The shape pointer.

  • partial_shape – The partial_shape pointer.

Returns:

Status code of the operation: OK(0) for success.

ov_partial_shape_is_dynamic(const ov_partial_shape_t partial_shape)#

Check this partial_shape whether is dynamic.

Parameters:

partial_shape – The partial_shape pointer.

Returns:

Status code of the operation: OK(0) for success.

ov_partial_shape_to_string(const ov_partial_shape_t partial_shape)#

Helper function, convert a partial shape to readable string.

Parameters:

partial_shape – The partial_shape pointer.

Returns:

A string reprensts partial_shape’s content.

struct ov_partial_shape#
#include <ov_partial_shape.h>

It represents a shape that may be partially or totally dynamic. A PartialShape may have: Dynamic rank. (Informal notation: ?) Static rank, but dynamic dimensions on some or all axes. (Informal notation examples: {1,2,?,4}, {?,?,?}, {-1,-1,-1}) Static rank, and static dimensions on all axes. (Informal notation examples: {1,2,3,4}, {6}, {})

An interface to make user can initialize ov_partial_shape_t

Public Members

ov_rank_t rank#

The rank.

ov_dimension_t *dims#

The dimension.