ONE - On-device Neural Engine
Loading...
Searching...
No Matches
loco::Dimension Class Referencefinal

The value of one dimension in a tensor shape. More...

#include <Dimension.h>

Public Member Functions

 Dimension ()=default
 Construct an "unknown" dimension.
 
 Dimension (uint32_t value)
 Construct a "known" dimension.
 
bool known (void) const
 Return whether the value is known (or not)
 
uint32_t value (void) const
 Return the value.
 
void set (uint32_t value)
 
void unset (void)
 

Detailed Description

The value of one dimension in a tensor shape.

Note
The value may be unknown

Definition at line 29 of file Dimension.h.

Constructor & Destructor Documentation

◆ Dimension() [1/2]

loco::Dimension::Dimension ( )
default

Construct an "unknown" dimension.

◆ Dimension() [2/2]

loco::Dimension::Dimension ( uint32_t  value)
inline

Construct a "known" dimension.

Definition at line 43 of file Dimension.h.

43{ set(value); }
uint32_t value(void) const
Return the value.
Definition Dimension.h:51
void set(uint32_t value)
Definition Dimension.h:53

References set(), and value().

Member Function Documentation

◆ known()

bool loco::Dimension::known ( void  ) const
inline

◆ set()

void loco::Dimension::set ( uint32_t  value)
inline

Definition at line 53 of file Dimension.h.

54 {
55 _kind = Kind::Known;
56 _value = value;
57 }

References value().

Referenced by Dimension(), luci::get_channel_dim_index(), luci::DynamicBatchToSingleBatchPass::run(), and luci::sinf::Algorithm::visit().

◆ unset()

void loco::Dimension::unset ( void  )
inline

Definition at line 59 of file Dimension.h.

60 {
61 _kind = Kind::Unknown;
62 _value = 0;
63 }

Referenced by moco::tensor_shape(), luci::sinf::Algorithm::visit(), and luci::sinf::Algorithm::visit().

◆ value()


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