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

#include <CompareLayer.h>

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

Public Member Functions

 CompareLayer ()
 
void configure (const IPortableTensor *lhs, const IPortableTensor *rhs, const ir::operation::Comparison::ComparisonType op_type, IPortableTensor *output)
 
void run () override
 
- Public Member Functions inherited from onert::exec::IFunction
virtual ~IFunction ()=default
 
virtual void prepare ()
 

Detailed Description

Definition at line 34 of file CompareLayer.h.

Constructor & Destructor Documentation

◆ CompareLayer()

onert::backend::cpu::ops::CompareLayer::CompareLayer ( )

Definition at line 125 of file CompareLayer.cc.

126 : _lhs(nullptr), _rhs(nullptr), _output(nullptr),
128{
129 // DO NOTHING
130}

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::CompareLayer::configure ( const IPortableTensor lhs,
const IPortableTensor rhs,
const ir::operation::Comparison::ComparisonType  op_type,
IPortableTensor output 
)

Definition at line 132 of file CompareLayer.cc.

134{
135 _lhs = lhs;
136 _rhs = rhs;
137 _op_type = op_type;
138 _output = output;
139}

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 141 of file CompareLayer.cc.

142{
143 if (_lhs->data_type() == OperandType::FLOAT32)
144 {
145 compareScalar<float>(_lhs, _rhs, _output, _op_type);
146 }
147 else if (_lhs->data_type() == OperandType::INT32)
148 {
149 compareScalar<int32_t>(_lhs, _rhs, _output, _op_type);
150 }
151 else if (_lhs->data_type() == OperandType::INT64)
152 {
153 compareScalar<int64_t>(_lhs, _rhs, _output, _op_type);
154 }
155 else if (_lhs->data_type() == OperandType::BOOL8)
156 {
157 compareScalar<uint8_t>(_lhs, _rhs, _output, _op_type);
158 }
159 else if (_lhs->data_type() == OperandType::QUANT_UINT8_ASYMM)
160 {
161 compareQuant8<uint8_t>(_lhs, _rhs, _output, _op_type);
162 }
163 else
164 {
165 throw std::runtime_error{"Compare: unsupported data type"};
166 }
167}
ir::DataType data_type() const override final

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

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


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