openvino.PartialShape#

class openvino.PartialShape#

Bases: pybind11_object

openvino.runtime.PartialShape wraps ov::PartialShape

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: openvino._pyopenvino.PartialShape, arg0: openvino._pyopenvino.Shape) -> None

  2. __init__(self: openvino._pyopenvino.PartialShape, arg0: openvino._pyopenvino.PartialShape) -> None

  3. __init__(self: openvino._pyopenvino.PartialShape, arg0: list) -> None

  4. __init__(self: openvino._pyopenvino.PartialShape, arg0: tuple) -> None

  5. __init__(self: openvino._pyopenvino.PartialShape, shape: str) -> None

Methods

__copy__(self)

__deepcopy__(self, arg0)

memo

__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).

__getitem__(*args, **kwargs)

Overloaded function.

__gt__(value, /)

Return self>value.

__init__(*args, **kwargs)

Overloaded function.

__init_subclass__

This method is called when a class is subclassed.

__iter__(self)

__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).

__setitem__(*args, **kwargs)

Overloaded function.

__sizeof__()

Size of object in memory, in bytes.

__str__(self)

__subclasshook__

Abstract classes can override this to customize issubclass().

compatible(self, shape)

Check whether this shape is compatible with the argument, i.e., whether it is possible to merge them.

dynamic(*args, **kwargs)

Overloaded function.

get_dimension(self, index)

Get the dimension at specified index of a partial shape.

get_max_shape(self)

return:

Get the max bounding shape.

get_min_shape(self)

return:

Get the min bounding shape.

get_shape(self)

return:

Get the unique shape.

refines(self, shape)

Check whether this shape is a refinement of the argument.

relaxes(self, shape)

Check whether this shape is a relaxation of the argument.

same_scheme(self, shape)

Check whether this shape represents the same scheme as the argument.

to_shape(self)

return:

Get the unique shape.

to_string(self)

Attributes

__hash__

all_non_negative

True if all static dimensions of the tensor are non-negative, else False.

is_dynamic

False if this shape is static, else True.

is_static

True if this shape is static, else False.

rank

The rank of the shape.

__class__#

alias of pybind11_type

__copy__(self: openvino._pyopenvino.PartialShape) openvino._pyopenvino.PartialShape#
__deepcopy__(self: openvino._pyopenvino.PartialShape, arg0: dict) openvino._pyopenvino.PartialShape#

memo

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(*args, **kwargs)#

Overloaded function.

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

  2. __eq__(self: openvino._pyopenvino.PartialShape, arg0: openvino._pyopenvino.Shape) -> bool

  3. __eq__(self: openvino._pyopenvino.PartialShape, arg0: tuple) -> bool

  4. __eq__(self: openvino._pyopenvino.PartialShape, arg0: list) -> bool

__format__(format_spec, /)#

Default object formatter.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getitem__(*args, **kwargs)#

Overloaded function.

  1. __getitem__(self: openvino._pyopenvino.PartialShape, arg0: int) -> openvino._pyopenvino.Dimension

  2. __getitem__(self: openvino._pyopenvino.PartialShape, arg0: slice) -> openvino._pyopenvino.PartialShape

__gt__(value, /)#

Return self>value.

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

Overloaded function.

  1. __init__(self: openvino._pyopenvino.PartialShape, arg0: openvino._pyopenvino.Shape) -> None

  2. __init__(self: openvino._pyopenvino.PartialShape, arg0: openvino._pyopenvino.PartialShape) -> None

  3. __init__(self: openvino._pyopenvino.PartialShape, arg0: list) -> None

  4. __init__(self: openvino._pyopenvino.PartialShape, arg0: tuple) -> None

  5. __init__(self: openvino._pyopenvino.PartialShape, shape: 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.

__iter__(self: openvino._pyopenvino.PartialShape) Iterator[openvino._pyopenvino.Dimension]#
__le__(value, /)#

Return self<=value.

__len__(self: openvino._pyopenvino.PartialShape) 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.PartialShape) str#
__setattr__(name, value, /)#

Implement setattr(self, name, value).

__setitem__(*args, **kwargs)#

Overloaded function.

  1. __setitem__(self: openvino._pyopenvino.PartialShape, arg0: int, arg1: int) -> None

  2. __setitem__(self: openvino._pyopenvino.PartialShape, arg0: int, arg1: openvino._pyopenvino.Dimension) -> None

__sizeof__()#

Size of object in memory, in bytes.

__str__(self: openvino._pyopenvino.PartialShape) 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).

property all_non_negative#

True if all static dimensions of the tensor are non-negative, else False.

compatible(self: openvino._pyopenvino.PartialShape, shape: openvino._pyopenvino.PartialShape) bool#

Check whether this shape is compatible with the argument, i.e., whether it is possible to merge them.

Parameters:

shape (openvino.runtime.PartialShape) – The shape to be checked for compatibility with this shape.

Returns:

True if this shape is compatible with s, else False.

Return type:

bool

static dynamic(*args, **kwargs)#

Overloaded function.

  1. dynamic(rank: openvino._pyopenvino.Dimension = <Dimension: ?>) -> openvino._pyopenvino.PartialShape

    Construct a PartialShape with the given rank and all dimensions are dynamic.

    param rank:

    The rank of the PartialShape. This is the number of dimensions in the shape.

    type rank:

    openvino.Dimension

    return:

    A PartialShape with the given rank (or undefined rank if not provided), and all dimensions are dynamic.

  2. dynamic(rank: int) -> openvino._pyopenvino.PartialShape

    Construct a PartialShape with the given rank and all dimensions are dynamic.

    param rank:

    The rank of the PartialShape. This is the number of dimensions in the shape.

    type rank:

    int

    return:

    A PartialShape with the given rank, and all dimensions are dynamic.

get_dimension(self: openvino._pyopenvino.PartialShape, index: int) openvino._pyopenvino.Dimension#

Get the dimension at specified index of a partial shape.

Parameters:

index (int) – The index of dimension.

Returns:

Get the particular dimension of a partial shape.

Return type:

openvino.runtime.Dimension

get_max_shape(self: openvino._pyopenvino.PartialShape) openvino._pyopenvino.Shape#
Returns:

Get the max bounding shape.

Return type:

openvino.runtime.Shape

get_min_shape(self: openvino._pyopenvino.PartialShape) openvino._pyopenvino.Shape#
Returns:

Get the min bounding shape.

Return type:

openvino.runtime.Shape

get_shape(self: openvino._pyopenvino.PartialShape) openvino._pyopenvino.Shape#
Returns:

Get the unique shape.

Return type:

openvino.runtime.Shape

property is_dynamic#

False if this shape is static, else True. A shape is considered static if it has static rank, and all dimensions of the shape are static.

property is_static#

True if this shape is static, else False. A shape is considered static if it has static rank, and all dimensions of the shape are static.

property rank#

The rank of the shape.

refines(self: openvino._pyopenvino.PartialShape, shape: openvino._pyopenvino.PartialShape) bool#

Check whether this shape is a refinement of the argument.

Parameters:

shape (openvino.runtime.PartialShape) – The shape which is being compared against this shape.

Returns:

True if this shape refines s, else False.

Return type:

bool

relaxes(self: openvino._pyopenvino.PartialShape, shape: openvino._pyopenvino.PartialShape) bool#

Check whether this shape is a relaxation of the argument.

Parameters:

shape (openvino.runtime.PartialShape) – The shape which is being compared against this shape.

Returns:

True if this shape relaxes s, else False.

Return type:

bool

same_scheme(self: openvino._pyopenvino.PartialShape, shape: openvino._pyopenvino.PartialShape) bool#

Check whether this shape represents the same scheme as the argument.

Parameters:

shape (openvino.runtime.PartialShape) – The shape which is being compared against this shape.

Returns:

True if shape represents the same scheme as s, else False.

Return type:

bool

to_shape(self: openvino._pyopenvino.PartialShape) openvino._pyopenvino.Shape#
Returns:

Get the unique shape.

Return type:

openvino.runtime.Shape

to_string(self: openvino._pyopenvino.PartialShape) str#