ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::cpu::ops::GatherLayer Class Reference

#include <GatherLayer.h>

Collaboration diagram for onert::backend::cpu::ops::GatherLayer:

Public Member Functions

 GatherLayer ()
 
void configure (const IPortableTensor *input, const IPortableTensor *indices, IPortableTensor *output, int32_t axis)
 
void run () override
 
- Public Member Functions inherited from onert::exec::IFunction
virtual ~IFunction ()=default
 
virtual void prepare ()
 

Detailed Description

Definition at line 27 of file GatherLayer.h.

Constructor & Destructor Documentation

◆ GatherLayer()

onert::backend::cpu::ops::GatherLayer::GatherLayer ( )
inline

Definition at line 30 of file GatherLayer.h.

30 : _input{nullptr}, _indices{nullptr}, _output{nullptr}, _axis{-1}
31 {
32 // DO NOTHING
33 }

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::GatherLayer::configure ( const IPortableTensor input,
const IPortableTensor indices,
IPortableTensor output,
int32_t  axis 
)

Definition at line 68 of file GatherLayer.cc.

70{
71 _input = input;
72 _indices = indices;
73 _axis = axis;
74 _output = output;
75}

◆ run()

void onert::backend::cpu::ops::GatherLayer::run ( )
overridevirtual

Implements onert::exec::IFunction.

Definition at line 108 of file GatherLayer.cc.

109{
110 switch (_input->data_type())
111 {
112 case OperandType::FLOAT32:
113 runByInputType<float>();
114 break;
115 case OperandType::QUANT_UINT8_ASYMM:
116 runByInputType<uint8_t>();
117 break;
118 case OperandType::INT32:
119 runByInputType<int32_t>();
120 break;
121 case OperandType::BOOL8:
122 runByInputType<bool>();
123 break;
124 default:
125 throw std::runtime_error("Gather: unsupported input data type");
126 }
127}
ir::DataType data_type() const override final

References onert::backend::IPortableTensor::data_type().


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