18#include "kernels/Utils.h"
50 for (
int i = 0;
i < 5; ++
i)
83 int32_t *
begins, int32_t *sizes)
86 for (
int idx = 0;
idx < dimensions; ++
idx)
99 Tensor::element_type(kernel.
output()));
101 Tensor::element_type(kernel.
input2()) == DataType::S64);
103 Tensor::element_type(kernel.
input3()) == DataType::S64);
115 const circle::Tensor *input = kernel.
input1();
118 const circle::Tensor *output = kernel.
output();
121 if (input_data ==
nullptr)
147 for (
int i = 0;
i < max_dim;
i++)
152 auto num_dim = Tensor::num_dims(input);
154 if (Tensor::element_type(
begin) == DataType::S32)
159 else if (Tensor::element_type(
begin) == DataType::S64)
166 assert(
false &&
"Unsupported type");
169#ifndef DIS_DYN_SHAPES
174 int offset = max_dim - Tensor::num_dims(input);
204 switch (Tensor::element_type(input))
207 case DataType::FLOAT32:
210 kernels::getTensorData<float>(output_data));
217 kernels::getTensorData<uint8_t>(output_data));
222 kernels::getTensorData<int8_t>(output_data));
227 kernels::getTensorData<int16_t>(output_data));
231 assert(
false &&
"Unsupported input type.");
uint8_t * getConstDataByTensor(const circle::Tensor *raw_tensor)
void addDynamicShapeTensor(const circle::Tensor *tensor, luci_interpreter::RuntimeShape &&shapes)
void resetTensorData(uint8_t *new_data, const circle::Tensor *tensor)
uint8_t * getDataByTensor(const circle::Tensor *raw_tensor)
static RuntimeShape extendedShape(int new_shape_size, const RuntimeShape &shape)
const circle::Tensor * input1() const
const circle::Tensor * input2() const
const circle::Tensor * input3() const
const circle::Tensor * output() const
#define LUCI_INTERPRETER_CHECK(cond)
__global uchar * offset(const Image *img, int x, int y)
const luci_interpreter::RuntimeShape output_shape
tflite::RuntimeShape getTensorShape(const Tensor *tensor)
void getBeginAndSizeVectors(int dimensions, const Tensor *begin, const Tensor *size, std::vector< int > *begins, std::vector< int > *sizes)
void configure_kernel_CircleSlice(const circle::Operator *cur_op, BaseRuntimeGraph *runtime_graph)
void execute_kernel_CircleSlice(const circle::Operator *cur_op, BaseRuntimeGraph *runtime_graph)
T must_cast(loco::Node *node)
const loco::Dimension & dim(uint32_t axis) const