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

#include <RangeLayer.h>

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

Public Member Functions

 RangeLayer ()
 
void configure (const IPortableTensor *start, const IPortableTensor *limit, const IPortableTensor *delta, IPortableTensor *output)
 
void run () override
 
- Public Member Functions inherited from onert::exec::IFunction
virtual ~IFunction ()=default
 
virtual void prepare ()
 

Detailed Description

Definition at line 32 of file RangeLayer.h.

Constructor & Destructor Documentation

◆ RangeLayer()

onert::backend::cpu::ops::RangeLayer::RangeLayer ( )

Definition at line 31 of file RangeLayer.cc.

31 : _start(nullptr), _limit(nullptr), _delta(nullptr), _output(nullptr)
32{
33 // DO NOTHING
34}

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::RangeLayer::configure ( const IPortableTensor start,
const IPortableTensor limit,
const IPortableTensor delta,
IPortableTensor output 
)

Definition at line 36 of file RangeLayer.cc.

38{
39 _start = start;
40 _limit = limit;
41 _delta = delta;
42 _output = output;
43}

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 45 of file RangeLayer.cc.

46{
47 switch (_output->data_type())
48 {
49 case OperandType::FLOAT32:
50 nnfw::cker::Range<float>(getBuffer<float>(_start), getBuffer<float>(_limit),
51 getBuffer<float>(_delta), getBuffer<float>(_output));
52 break;
53 case OperandType::INT32:
54 nnfw::cker::Range<int32_t>(getBuffer<int32_t>(_start), getBuffer<int32_t>(_limit),
55 getBuffer<int32_t>(_delta), getBuffer<int32_t>(_output));
56 break;
57 default:
58 throw std::runtime_error{"Range: unsupported data type"};
59 break;
60 }
61}
ir::DataType data_type() const override final

References onert::backend::IPortableTensor::data_type().

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


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