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

#include <SquaredDiffLayer.h>

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

Public Member Functions

 SqDiffLayer ()
 
void SqDiffFloat32 ()
 
void configure (const IPortableTensor *input1, const IPortableTensor *input2, IPortableTensor *output)
 
void run () override
 
- Public Member Functions inherited from onert::exec::IFunction
virtual ~IFunction ()=default
 
virtual void prepare ()
 

Detailed Description

Definition at line 33 of file SquaredDiffLayer.h.

Constructor & Destructor Documentation

◆ SqDiffLayer()

onert::backend::cpu::ops::SqDiffLayer::SqDiffLayer ( )

Definition at line 32 of file SquaredDiffLayer.cc.

32 : _input1(nullptr), _input2(nullptr), _output(nullptr)
33{
34 // DO NOTHING
35}

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::SqDiffLayer::configure ( const IPortableTensor input1,
const IPortableTensor input2,
IPortableTensor output 
)

Definition at line 43 of file SquaredDiffLayer.cc.

45{
46 _input1 = input1;
47 _input2 = input2;
48 _output = output;
49}

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 51 of file SquaredDiffLayer.cc.

52{
53 if (_input1->data_type() == OperandType::FLOAT32)
54 {
56 }
57 else
58 {
59 throw std::runtime_error{"SquaredDiff: unsupported data type"};
60 }
61}
ir::DataType data_type() const override final

References onert::backend::IPortableTensor::data_type(), and SqDiffFloat32().

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

◆ SqDiffFloat32()

void onert::backend::cpu::ops::SqDiffLayer::SqDiffFloat32 ( )

Definition at line 37 of file SquaredDiffLayer.cc.

38{
39 nnfw::cker::SqDiff(getShape(_input1), getBuffer<float>(_input1), getShape(_input2),
40 getBuffer<float>(_input2), getShape(_output), getBuffer<float>(_output));
41}
void SqDiff(const Shape &input1_shape, const T *input1_data, const Shape &input2_shape, const T *input2_data, const Shape &output_shape, T *output_data)
Definition SqDiff.h:63
nnfw::cker::Shape getShape(const IPortableTensor *tensor)

References onert::backend::cpu::ops::getShape(), and nnfw::cker::SqDiff().

Referenced by run().


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