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

#include <ShapeLayer.h>

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

Public Member Functions

 ShapeLayer ()
 
void configure (const IPortableTensor *input, IPortableTensor *output)
 
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 ShapeLayer.h.

Constructor & Destructor Documentation

◆ ShapeLayer()

onert::backend::cpu::ops::ShapeLayer::ShapeLayer ( )

Definition at line 48 of file ShapeLayer.cc.

48 : _input(nullptr), _output(nullptr)
49{
50 // DO NOTHING
51}

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::ShapeLayer::configure ( const IPortableTensor input,
IPortableTensor output 
)

Definition at line 62 of file ShapeLayer.cc.

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 68 of file ShapeLayer.cc.

69{
70 if (_output->data_type() == OperandType::UINT32)
71 {
72 GetRawShape(_input, getBuffer<uint32_t>(_output));
73 }
74 else if (_output->data_type() == OperandType::INT32)
75 {
76 GetRawShape(_input, getBuffer<int32_t>(_output));
77 }
78 else if (_output->data_type() == OperandType::INT64)
79 {
80 GetRawShape(_input, getBuffer<int64_t>(_output));
81 }
82 else
83 {
84 throw std::runtime_error{"NYI : not supported output type for ShapeLayer"};
85 }
86}
ir::DataType data_type() const override final
void GetRawShape(const IPortableTensor *input, T *output_data)
Definition ShapeLayer.cc:53

References onert::backend::IPortableTensor::data_type(), and onert::backend::cpu::ops::GetRawShape().


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