ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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, ExternalContext *ctx)
 
void run () override
 
- Public Member Functions inherited from onert::exec::IFunction
virtual ~IFunction ()=default
 
virtual void prepare ()
 

Detailed Description

Definition at line 29 of file GatherLayer.h.

Constructor & Destructor Documentation

◆ GatherLayer()

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

Definition at line 32 of file GatherLayer.h.

32 : _input{nullptr}, _indices{nullptr}, _output{nullptr}, _axis{-1}, _ctx{nullptr}
33 {
34 // DO NOTHING
35 }

Member Function Documentation

◆ configure()

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

Definition at line 27 of file GatherLayer.cc.

29{
30 _input = input;
31 _indices = indices;
32 _axis = axis;
33 _output = output;
34 _ctx = ctx;
35
36 if (_input->data_type() == OperandType::QUANT_GGML_Q4_0)
37 ctx->initGgmlContext();
38}
ir::DataType data_type() const override final

References onert::backend::IPortableTensor::data_type(), and onert::backend::cpu::ExternalContext::initGgmlContext().

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 118 of file GatherLayer.cc.

119{
120 switch (_input->data_type())
121 {
122 case OperandType::FLOAT32:
123 runByInputType<float>();
124 break;
125 case OperandType::QUANT_UINT8_ASYMM:
126 runByInputType<uint8_t>();
127 break;
128 case OperandType::INT32:
129 runByInputType<int32_t>();
130 break;
131 case OperandType::QUANT_GGML_Q4_0:
132 runByGGMLQuantInputType();
133 break;
134 default:
135 throw std::runtime_error("Gather: unsupported input data type");
136 }
137}

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


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