46 const circle::Tensor *input1;
47 const circle::Tensor *input2;
48 const circle::Tensor *
output;
54 const circle::DivOptions *
options;
58 runtime_kernel.
readKernel(op_index, runtime_context);
63 assert(input1 !=
nullptr);
64 assert(input2 !=
nullptr);
65 assert(output !=
nullptr);
72 assert(input1_data !=
nullptr);
73 assert(input2_data !=
nullptr);
74 assert(output_data !=
nullptr);
88 switch (input1->type())
91 case circle::TensorType_FLOAT32:
94 ¶ms.float_activation_min,
95 ¶ms.float_activation_max);
100 params, input1_shape, core::utils::castInputData<float>(input1_data), input2_shape,
101 core::utils::castInputData<float>(input2_data),
output_shape,
102 core::utils::castOutputData<float>(output_data));
107 pal::Div(params, input1_shape.flatSize(), core::utils::castInputData<float>(input1_data),
108 core::utils::castInputData<float>(input2_data),
109 core::utils::castOutputData<float>(output_data));
114 case circle::TensorType_INT64:
117 ¶ms.int64_activation_min,
118 ¶ms.int64_activation_max);
123 params, input1_shape, core::utils::castInputData<int64_t>(input1_data), input2_shape,
124 core::utils::castInputData<int64_t>(input2_data),
output_shape,
125 core::utils::castOutputData<int64_t>(output_data));
129 status =
pal::Div(params, input1_shape.flatSize(),
130 core::utils::castInputData<int64_t>(input1_data),
131 core::utils::castInputData<int64_t>(input2_data),
132 core::utils::castOutputData<int64_t>(output_data));
136 case circle::TensorType_INT32:
139 ¶ms.int32_activation_min,
140 ¶ms.int32_activation_max);
145 params, input1_shape, core::utils::castInputData<int32_t>(input1_data), input2_shape,
146 core::utils::castInputData<int32_t>(input2_data),
output_shape,
147 core::utils::castOutputData<int32_t>(output_data));
151 status =
pal::Div(params, input1_shape.flatSize(),
152 core::utils::castInputData<int32_t>(input1_data),
153 core::utils::castInputData<int32_t>(input2_data),
154 core::utils::castOutputData<int32_t>(output_data));
161 assert(
false &&
"Unsupported type.");
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
constexpr uint32_t input1TensorIdx
constexpr uint32_t outputTensorIdx
constexpr uint32_t input2TensorIdx
const std::vector< float > input1_data
const std::vector< float > input2_data
OMStatus BroadcastDiv4DSlow(const core::BinaryArithmeticBroadcastParams ¶ms, const core::OMRuntimeShape &input1_shape, const T *input1_data, const core::OMRuntimeShape &input2_shape, const T *input2_data, const core::OMRuntimeShape &output_shape, T *output_data)
bool processBroadcastShapes(const core::OMRuntimeShape &shape0, const core::OMRuntimeShape &shape1, core::BinaryArithmeticBroadcastParams *params)
OMStatus Div(const core::BinaryArithmeticBroadcastParams ¶ms, const int flat_size, const T *input1_data, const T *input2_data, T *output_data)
OMStatus calculateActivationRange(circle::ActivationFunctionType activation, T *activation_min, T *activation_max)
core::OMRuntimeContext & runtime_context
core::OMRuntimeStorage & runtime_storage