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, ExternalContext *ctx)
 
void run () override
 
- Public Member Functions inherited from onert::exec::IFunction
virtual ~IFunction ()=default
 
virtual void prepare ()
 

Detailed Description

Definition at line 35 of file GatherLayer.h.

Constructor & Destructor Documentation

◆ GatherLayer()

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

Definition at line 38 of file GatherLayer.h.

38 : _input{nullptr}, _indices{nullptr}, _output{nullptr}, _axis{-1}, _ctx{nullptr}
39 {
40 // DO NOTHING
41 }

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 33 of file GatherLayer.cc.

35{
36 _input = input;
37 _indices = indices;
38 _axis = axis;
39 _output = output;
40 _ctx = ctx;
41
42 if (_input->data_type() == OperandType::QUANT_GGML_Q4_0)
43 ctx->initGgmlContext();
44}
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 124 of file GatherLayer.cc.

125{
126 switch (_input->data_type())
127 {
128 case OperandType::FLOAT32:
129 runByInputType<float>();
130 break;
131 case OperandType::QUANT_UINT8_ASYMM:
132 runByInputType<uint8_t>();
133 break;
134 case OperandType::INT32:
135 runByInputType<int32_t>();
136 break;
137 case OperandType::QUANT_GGML_Q4_0:
138 runByGGMLQuantInputType();
139 break;
140 default:
141 throw std::runtime_error("Gather: unsupported input data type");
142 }
143}

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

Referenced by package.infer.session::inference().


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