ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::backend::train::DisposableTensorIndex Class Reference

Class that is index of DisposableTensor. More...

#include <DisposableTensorIndex.h>

Public Member Functions

 DisposableTensorIndex (const ir::OperationIndex &op_index, const ir::OperandIndex &operand_index)
 Construct DisposableTensorIndex object.
 
const ir::OperationIndexop_index () const
 Get Operation index.
 
const ir::OperandIndexoperand_index () const
 Get operand index.
 
bool operator== (const DisposableTensorIndex &other) const
 operator overloading function for ==
 
bool operator!= (const DisposableTensorIndex &other) const
 operator overloading function for !=
 

Detailed Description

Class that is index of DisposableTensor.

Definition at line 32 of file DisposableTensorIndex.h.

Constructor & Destructor Documentation

◆ DisposableTensorIndex()

onert::backend::train::DisposableTensorIndex::DisposableTensorIndex ( const ir::OperationIndex op_index,
const ir::OperandIndex operand_index 
)
inline

Construct DisposableTensorIndex object.

Parameters
op_indexThe operation index
operand_indexThe operand index

Definition at line 40 of file DisposableTensorIndex.h.

41 : _op_index{op_index}, _operand_index{operand_index}
42 {
43 assert(op_index.valid());
44 assert(operand_index.valid());
45 // NOTE This constraint is necessary to check overflow of hash value
46 assert((op_index.value() < (1 << 16) && operand_index.value() < (1 << 16)) &&
47 "DisposableTensorIndex does not support index value of operation or "
48 "operand greater than 65535");
49 }
const ir::OperandIndex & operand_index() const
Get operand index.
const ir::OperationIndex & op_index() const
Get Operation index.
bool valid() const
Check whether the value is valid or not.
Definition Index.h:125
T value() const
Return underlying value.
Definition Index.h:137

References op_index(), operand_index(), onert::util::Index< T, DummyTag >::valid(), and onert::util::Index< T, DummyTag >::value().

Member Function Documentation

◆ op_index()

const ir::OperationIndex & onert::backend::train::DisposableTensorIndex::op_index ( ) const
inline

Get Operation index.

Returns
Operation index

Definition at line 57 of file DisposableTensorIndex.h.

57{ return _op_index; }

Referenced by DisposableTensorIndex(), and operator==().

◆ operand_index()

const ir::OperandIndex & onert::backend::train::DisposableTensorIndex::operand_index ( ) const
inline

Get operand index.

Returns
Operand index

Definition at line 63 of file DisposableTensorIndex.h.

63{ return _operand_index; }

Referenced by DisposableTensorIndex(), onert::backend::train::operator<<(), and operator==().

◆ operator!=()

bool onert::backend::train::DisposableTensorIndex::operator!= ( const DisposableTensorIndex other) const
inline

operator overloading function for !=

Returns
Whether two DisposableTensorIndex are differenct

Definition at line 80 of file DisposableTensorIndex.h.

80{ return !(*this == other); }

◆ operator==()

bool onert::backend::train::DisposableTensorIndex::operator== ( const DisposableTensorIndex other) const
inline

operator overloading function for ==

Returns
Whether two DisposableTensorIndex are the same

Definition at line 71 of file DisposableTensorIndex.h.

72 {
73 return _op_index == other.op_index() && _operand_index == other.operand_index();
74 }

References op_index(), and operand_index().


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