openvino.Dimension

class openvino.Dimension

Bases: pybind11_builtins.pybind11_object

openvino.runtime.Dimension wraps ov::Dimension

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: openvino._pyopenvino.Dimension) -> None

  2. __init__(self: openvino._pyopenvino.Dimension, dimension: int) -> None

    Construct a static dimension.

    param dimension

    Value of the dimension.

    type dimension

    int

  3. __init__(self: openvino._pyopenvino.Dimension, min_dimension: int, max_dimension: int) -> None

    Construct a dynamic dimension with bounded range.

    param min_dimension

    The lower inclusive limit for the dimension.

    type min_dimension

    int

    param max_dimension

    The upper inclusive limit for the dimension.

    type max_dimension

    int

  4. __init__(self: openvino._pyopenvino.Dimension, str: str) -> None

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(*args, **kwargs)

Overloaded function.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__init__(*args, **kwargs)

Overloaded function.

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__len__(self)

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__(self)

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__(self)

__subclasshook__

Abstract classes can override this to customize issubclass().

compatible(self, dim)

Check whether this dimension is capable of being merged with the argument dimension.

dynamic()

get_length(self)

Return this dimension as integer.

get_max_length(self)

Return this dimension's max_dimension as integer.

get_min_length(self)

Return this dimension's min_dimension as integer.

refines(self, dim)

Check whether this dimension is a refinement of the argument.

relaxes(self, dim)

Check whether this dimension is a relaxation of the argument.

same_scheme(self, dim)

Return this dimension's max_dimension as integer.

to_string(self)

Attributes

__hash__

is_dynamic

Check if Dimension is dynamic.

is_static

Check if Dimension is static.

max_length

Return this dimension's max_dimension as integer.

min_length

Return this dimension's min_dimension as integer.

__class__

alias of pybind11_builtins.pybind11_type

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(*args, **kwargs)

Overloaded function.

  1. __eq__(self: openvino._pyopenvino.Dimension, arg0: openvino._pyopenvino.Dimension) -> bool

  2. __eq__(self: openvino._pyopenvino.Dimension, arg0: int) -> bool

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__hash__ = None
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: openvino._pyopenvino.Dimension) -> None

  2. __init__(self: openvino._pyopenvino.Dimension, dimension: int) -> None

    Construct a static dimension.

    param dimension

    Value of the dimension.

    type dimension

    int

  3. __init__(self: openvino._pyopenvino.Dimension, min_dimension: int, max_dimension: int) -> None

    Construct a dynamic dimension with bounded range.

    param min_dimension

    The lower inclusive limit for the dimension.

    type min_dimension

    int

    param max_dimension

    The upper inclusive limit for the dimension.

    type max_dimension

    int

  4. __init__(self: openvino._pyopenvino.Dimension, str: str) -> None

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)

Return self<=value.

__len__(self: openvino._pyopenvino.Dimension) int
__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)
__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__(self: openvino._pyopenvino.Dimension) str
__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__(self: openvino._pyopenvino.Dimension) str
__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

compatible(self: openvino._pyopenvino.Dimension, dim: openvino._pyopenvino.Dimension) bool

Check whether this dimension is capable of being merged with the argument dimension.

Parameters

dim (Dimension) – The dimension to compare this dimension with.

Returns

True if this dimension is compatible with d, else False.

Return type

bool

static dynamic() openvino._pyopenvino.Dimension
get_length(self: openvino._pyopenvino.Dimension) int

Return this dimension as integer. This dimension must be static and non-negative.

Returns

Value of the dimension.

Return type

int

get_max_length(self: openvino._pyopenvino.Dimension) int

Return this dimension’s max_dimension as integer. This dimension must be dynamic and non-negative.

Returns

Value of the dimension.

Return type

int

get_min_length(self: openvino._pyopenvino.Dimension) int

Return this dimension’s min_dimension as integer. This dimension must be dynamic and non-negative.

Returns

Value of the dimension.

Return type

int

property is_dynamic

Check if Dimension is dynamic. :return: True if dynamic, else False. :rtype: bool

property is_static

Check if Dimension is static.

Returns

True if static, else False.

Return type

bool

property max_length

Return this dimension’s max_dimension as integer. This dimension must be dynamic and non-negative.

Returns

Value of the dimension.

Return type

int

property min_length

Return this dimension’s min_dimension as integer. This dimension must be dynamic and non-negative.

Returns

Value of the dimension.

Return type

int

refines(self: openvino._pyopenvino.Dimension, dim: openvino._pyopenvino.Dimension) bool

Check whether this dimension is a refinement of the argument. This dimension refines (or is a refinement of) d if:

  1. this and d are static and equal

  2. d dimension contains this dimension

this.refines(d) is equivalent to d.relaxes(this).

Parameters

dim (Dimension) – The dimension to compare this dimension with.

Returns

True if this dimension refines d, else False.

Return type

bool

relaxes(self: openvino._pyopenvino.Dimension, dim: openvino._pyopenvino.Dimension) bool

Check whether this dimension is a relaxation of the argument. This dimension relaxes (or is a relaxation of) d if:

  1. this and d are static and equal

  2. this dimension contains d dimension

this.relaxes(d) is equivalent to d.refines(this).

Parameters

dim (Dimension) – The dimension to compare this dimension with.

Returns

True if this dimension relaxes d, else False.

Return type

bool

same_scheme(self: openvino._pyopenvino.Dimension, dim: openvino._pyopenvino.Dimension) bool

Return this dimension’s max_dimension as integer. This dimension must be dynamic and non-negative.

Parameters

dim (Dimension) – The other dimension to compare this dimension to.

Returns

True if this dimension and dim are both dynamic, or if they are both static and equal, otherwise False.

Return type

bool

to_string(self: openvino._pyopenvino.Dimension) str