ONE - On-device Neural Engine
Loading...
Searching...
No Matches
circle_resizer::Dim Class Reference

#include <Dim.h>

Public Member Functions

 Dim (int32_t dim)
 Initialize single dimension. Note that '-1' means a dynamic dimension.
 
bool is_dynamic () const
 Returns true if the dimension is dynamic. Otherwise, return false.
 
int32_t value () const
 Returns value of dimension in int32_t representation.
 
bool operator== (const Dim &rhs) const
 Returns true of the current dimension and the provided rhs are equal.
 

Static Public Member Functions

static Dim dynamic ()
 Create dynamic dimension. Note that it's equivalent of Dim{-1}.
 

Detailed Description

The representation of a single dimension. Note that a dimension can be dynamic.

Definition at line 28 of file Dim.h.

Constructor & Destructor Documentation

◆ Dim()

Dim::Dim ( int32_t  dim)
explicit

Initialize single dimension. Note that '-1' means a dynamic dimension.

Exceptions:

  • std::runtime_error if provided dim value is less than -1.

Definition at line 23 of file Dim.cpp.

23 : _dim_value{dim}
24{
25 if (dim < -1)
26 {
27 throw std::runtime_error("Invalid value of dimension: " + dim);
28 }
29}

Member Function Documentation

◆ dynamic()

Dim Dim::dynamic ( )
static

Create dynamic dimension. Note that it's equivalent of Dim{-1}.

Definition at line 31 of file Dim.cpp.

31{ return Dim{-1}; }

◆ is_dynamic()

bool Dim::is_dynamic ( ) const

Returns true if the dimension is dynamic. Otherwise, return false.

Definition at line 33 of file Dim.cpp.

33{ return _dim_value == -1; }

Referenced by circle_resizer::Shape::is_dynamic().

◆ operator==()

bool Dim::operator== ( const Dim rhs) const

Returns true of the current dimension and the provided rhs are equal.

Definition at line 37 of file Dim.cpp.

37{ return value() == rhs.value(); }
int32_t value() const
Returns value of dimension in int32_t representation.
Definition Dim.cpp:35

References value().

◆ value()

int32_t Dim::value ( ) const

Returns value of dimension in int32_t representation.

Definition at line 35 of file Dim.cpp.

35{ return _dim_value; }

Referenced by operator==().


The documentation for this class was generated from the following files: