ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 24 of file ShapeLayer.cc.

24 : _input(nullptr), _output(nullptr)
25{
26 // DO NOTHING
27}

Member Function Documentation

◆ configure()

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

Definition at line 38 of file ShapeLayer.cc.

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 44 of file ShapeLayer.cc.

45{
46 if (_output->data_type() == OperandType::UINT32)
47 {
48 GetRawShape(_input, getBuffer<uint32_t>(_output));
49 }
50 else if (_output->data_type() == OperandType::INT32)
51 {
52 GetRawShape(_input, getBuffer<int32_t>(_output));
53 }
54 else if (_output->data_type() == OperandType::INT64)
55 {
56 GetRawShape(_input, getBuffer<int64_t>(_output));
57 }
58 else
59 {
60 throw std::runtime_error{"NYI : not supported output type for ShapeLayer"};
61 }
62}
ir::DataType data_type() const override final
void GetRawShape(const IPortableTensor *input, T *output_data)
Definition ShapeLayer.cc:29

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


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