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

#include <FillLayer.h>

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

Public Member Functions

 FillLayer ()
 
void configure (const IPortableTensor *value, 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 FillLayer.h.

Constructor & Destructor Documentation

◆ FillLayer()

onert::backend::cpu::ops::FillLayer::FillLayer ( )

Definition at line 32 of file FillLayer.cc.

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

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::FillLayer::configure ( const IPortableTensor value,
IPortableTensor output 
)

Definition at line 37 of file FillLayer.cc.

38{
39 _value = value;
40 _output = output;
41}

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 43 of file FillLayer.cc.

44{
45 switch (_output->data_type())
46 {
47 case OperandType::FLOAT32:
48 nnfw::cker::Fill<float>(getBuffer<float>(_value), getShape(_output),
49 getBuffer<float>(_output));
50 break;
51 case OperandType::INT32:
52 nnfw::cker::Fill<int32_t>(getBuffer<int32_t>(_value), getShape(_output),
53 getBuffer<int32_t>(_output));
54 break;
55 case OperandType::INT64:
56 nnfw::cker::Fill<int64_t>(getBuffer<int64_t>(_value), getShape(_output),
57 getBuffer<int64_t>(_output));
58 break;
59 case OperandType::UINT32:
60 nnfw::cker::Fill<uint32_t>(getBuffer<uint32_t>(_value), getShape(_output),
61 getBuffer<uint32_t>(_output));
62 break;
63 default:
64 throw std::runtime_error{"Fill: unsupported data type"};
65 }
66}
ir::DataType data_type() const override final
nnfw::cker::Shape getShape(const IPortableTensor *tensor)

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

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


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