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 33 of file ShapeLayer.h.

Constructor & Destructor Documentation

◆ ShapeLayer()

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

Definition at line 30 of file ShapeLayer.cc.

30 : _input(nullptr), _output(nullptr)
31{
32 // DO NOTHING
33}

Member Function Documentation

◆ configure()

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

Definition at line 44 of file ShapeLayer.cc.

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 50 of file ShapeLayer.cc.

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

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

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


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