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

#include <SliceLayer.h>

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

Public Member Functions

 SliceLayer ()
 
void configure (const IPortableTensor *input, const IPortableTensor *begin, const IPortableTensor *size, 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 SliceLayer.h.

Constructor & Destructor Documentation

◆ SliceLayer()

onert::backend::cpu::ops::SliceLayer::SliceLayer ( )

Definition at line 32 of file SliceLayer.cc.

32 : _input(nullptr), _begin(nullptr), _size(nullptr), _output(nullptr)
33{
34 // DO NOTHING
35}

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::SliceLayer::configure ( const IPortableTensor input,
const IPortableTensor begin,
const IPortableTensor size,
IPortableTensor output 
)

Definition at line 91 of file SliceLayer.cc.

93{
94 _input = input;
95 _output = output;
96 _begin = begin;
97 _size = size;
98}
int32_t size[5]
Definition Slice.cpp:35
int32_t begin[5]
Definition Slice.cpp:33

References begin, and size.

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 100 of file SliceLayer.cc.

101{
102 if (_input->data_type() == OperandType::FLOAT32)
103 {
104 sliceImpl<float>();
105 }
106 else if (_input->data_type() == OperandType::QUANT_UINT8_ASYMM)
107 {
108 sliceImpl<uint8_t>();
109 }
110 else
111 {
112 throw std::runtime_error{"Slice: unsupported data type"};
113 }
114}
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: