ONE - On-device Neural Engine
Loading...
Searching...
No Matches
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 36 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 44 of file DisposableTensorIndex.h.

45 : _op_index{op_index}, _operand_index{operand_index}
46 {
47 assert(op_index.valid());
48 assert(operand_index.valid());
49 // NOTE This constraint is necessary to check overflow of hash value
50 assert((op_index.value() < (1 << 16) && operand_index.value() < (1 << 16)) &&
51 "DisposableTensorIndex does not support index value of operation or "
52 "operand greater than 65535");
53 }
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:127
T value() const
Return underlying value.
Definition Index.h:139

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 61 of file DisposableTensorIndex.h.

61{ 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 67 of file DisposableTensorIndex.h.

67{ 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 84 of file DisposableTensorIndex.h.

84{ 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 75 of file DisposableTensorIndex.h.

76 {
77 return _op_index == other.op_index() && _operand_index == other.operand_index();
78 }

References op_index(), and operand_index().


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