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

#include <StridedSliceLayer.h>

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

Public Member Functions

 StridedSliceLayer ()
 
void configure (const IPortableTensor *input, const IPortableTensor *begin, const IPortableTensor *end, const IPortableTensor *strides, IPortableTensor *output, const int32_t begin_mask, const int32_t end_mask, const int32_t shrink_axis_mask)
 
void run () override
 
- Public Member Functions inherited from onert::exec::IFunction
virtual ~IFunction ()=default
 
virtual void prepare ()
 

Detailed Description

Definition at line 34 of file StridedSliceLayer.h.

Constructor & Destructor Documentation

◆ StridedSliceLayer()

onert::backend::cpu::ops::StridedSliceLayer::StridedSliceLayer ( )

Definition at line 32 of file StridedSliceLayer.cc.

33 : _input(nullptr), _begin(nullptr), _end(nullptr), _strides(nullptr), _output(nullptr),
34 _begin_mask(0), _ellipsis_mask(0), _end_mask(0), _new_axis_mask(0), _shrink_axis_mask(0)
35{
36}

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::StridedSliceLayer::configure ( const IPortableTensor input,
const IPortableTensor begin,
const IPortableTensor end,
const IPortableTensor strides,
IPortableTensor output,
const int32_t  begin_mask,
const int32_t  end_mask,
const int32_t  shrink_axis_mask 
)

Definition at line 52 of file StridedSliceLayer.cc.

56{
57 _input = input;
58 _begin = begin;
59 _end = end;
60 _strides = strides;
61 _output = output;
62
63 _begin_mask = begin_mask;
64 _ellipsis_mask = 0;
65 _end_mask = end_mask;
66 _new_axis_mask = 0;
67 _shrink_axis_mask = shrink_axis_mask;
68}
ShapeIterator end(const Shape &s)
int32_t begin[5]
Definition Slice.cpp:33

References begin.

◆ run()

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

Implements onert::exec::IFunction.

Definition at line 70 of file StridedSliceLayer.cc.

71{
72 if (_input->data_type() == OperandType::FLOAT32)
73 {
74 stridedSliceImpl<float>();
75 }
76 else if (_input->data_type() == OperandType::INT32)
77 {
78 stridedSliceImpl<int32_t>();
79 }
80 else if (_input->data_type() == OperandType::INT64)
81 {
82 stridedSliceImpl<int64_t>();
83 }
84 else
85 {
86 throw std::runtime_error{"StridedSlice: unsupported data type"};
87 }
88}
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: