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

#include <ReshapeLayer.h>

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

Public Member Functions

 ReshapeLayer ()
 
void reshapeGeneric ()
 
void configure (const IPortableTensor *input, const IPortableTensor *shape, 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 ReshapeLayer.h.

Constructor & Destructor Documentation

◆ ReshapeLayer()

onert::backend::cpu::ops::ReshapeLayer::ReshapeLayer ( )

Definition at line 28 of file ReshapeLayer.cc.

28 : _input(nullptr), _shape(nullptr), _output(nullptr)
29{
30 // DO NOTHING
31}

Member Function Documentation

◆ configure()

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

Definition at line 43 of file ReshapeLayer.cc.

45{
46 _input = input;
47 /* note : shape is optional. If not provided from model, _shape is nullptr. */
48 _shape = shape;
49 _output = output;
50}

◆ reshapeGeneric()

void onert::backend::cpu::ops::ReshapeLayer::reshapeGeneric ( )

Definition at line 33 of file ReshapeLayer.cc.

34{
35 // output buffer equals to input buffer means that copy is not needed
36 if (_output->buffer() != _input->buffer())
37 {
38 size_t count = _input->total_size();
39 memcpy(_output->buffer(), _input->buffer(), count);
40 }
41}
size_t total_size() const override final
virtual uint8_t * buffer() const =0

References onert::backend::ITensor::buffer(), and onert::backend::IPortableTensor::total_size().

Referenced by run().

◆ run()

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

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