ngraph.Dimension

class ngraph.Dimension

Bases: pybind11_builtins.pybind11_object

ngraph.impl.Dimension wraps ngraph::Dimension

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _pyngraph.Dimension) -> None

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

    Construct a static dimension.

    param dimension

    Value of the dimension.

    type dimension

    int

  3. __init__(self: _pyngraph.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

    inclusive limit for the dimension.

    type max_dimension

    The upper inclusive limit for the dimension.

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, d)

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, d)

Check whether this dimension is a refinement of the argument.

relaxes(self, d)

Check whether this dimension is a relaxation of the argument.

same_scheme(self, dim)

Return this dimension's max_dimension as integer.

Attributes

__hash__

__pybind11_module_local_v4_gcc_libstdcpp_cxxabi1014__

is_dynamic

Check if Dimension is dynamic.

is_static

Check if Dimension is static.

__annotations__ = {}
__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: _pyngraph.Dimension, arg0: _pyngraph.Dimension) -> bool

  2. __eq__(self: _pyngraph.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: _pyngraph.Dimension) -> None

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

    Construct a static dimension.

    param dimension

    Value of the dimension.

    type dimension

    int

  3. __init__(self: _pyngraph.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

    inclusive limit for the dimension.

    type max_dimension

    The upper inclusive limit for the dimension.

__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: _pyngraph.Dimension) int
__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)
__pybind11_module_local_v4_gcc_libstdcpp_cxxabi1014__ = <capsule object NULL>
__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

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

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__(self: _pyngraph.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: _pyngraph.Dimension, d: _pyngraph.Dimension) bool

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

Parameters

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

Returns

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

Return type

bool

static dynamic() _pyngraph.Dimension
get_length(self: _pyngraph.Dimension) int

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

:return Value of the dimension. :rtype: int

get_max_length(self: _pyngraph.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: _pyngraph.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.

Returns

True if dynamic, else False.

Return type

bool

property is_static

Check if Dimension is static.

Returns

True if static, else False.

Return type

bool

refines(self: _pyngraph.Dimension, d: _pyngraph.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

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

Returns

True if this dimension refines d, else False.

Return type

bool

relaxes(self: _pyngraph.Dimension, d: _pyngraph.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

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

Returns

True if this dimension relaxes d, else False.

Return type

bool

same_scheme(self: _pyngraph.Dimension, dim: _pyngraph.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. :rtype: bool