38 const int values_count =
options->values_count();
48 for (
int i = 0; i < axis; ++i)
52 for (
int i = axis + 1; i < dimensions; ++i)
56 for (
int i = 0; i < input_shape.dimensionsCount(); ++i)
57 input_size *= input_shape.dims(i);
59 assert(input_size == copy_size * outer_size);
62 assert(output_data !=
nullptr);
64 for (
int i = 0; i < values_count; ++i)
67 assert(input_data !=
nullptr);
68 for (
int k = 0; k < outer_size; ++k)
70 const T *input_ptr =
input_data + copy_size * k;
71 int loc = k * values_count * copy_size + i * copy_size;
73 for (
int j = 0; j < copy_size; ++j)
74 output_ptr[j] = input_ptr[j];
88 runtime_kernel.
readKernel(op_index, runtime_context);
90 const auto type = runtime_kernel.
inputs[0]->type();
93 status = runtime_kernel.
getDataFromStorage(op_index, runtime_storage, runtime_context);
101 case circle::TensorType_FLOAT32:
102 packImpl<float>(runtime_kernel);
106 case circle::TensorType_INT8:
107 packImpl<int8_t>(runtime_kernel);
110 case circle::TensorType_INT32:
111 packImpl<int32_t>(runtime_kernel);
113 case circle::TensorType_INT64:
114 packImpl<int64_t>(runtime_kernel);
117 assert(
false &&
"Unsupported type.");
int32_t dimensionsCount() const
int32_t dims(int i) const
uint8_t * outputs_data[maxOutputSize]
const circle::Operator * first_operator
OMStatus getDataFromStorage(uint16_t op_index, core::OMRuntimeStorage &storage, core::OMRuntimeContext &context)
uint8_t * inputs_data[maxInputSize]
OMStatus readKernel(uint16_t op_index, core::OMRuntimeContext &runtime_context)
const circle::Tensor * outputs[maxOutputSize]
const circle::Tensor * inputs[maxInputSize]
const luci_interpreter::RuntimeShape output_shape
core::OMRuntimeContext & runtime_context
core::OMRuntimeStorage & runtime_storage