34constexpr uint32_t inputTensorIdx = 0;
45 if (
args.is_last_layer)
53 uint16_t op_index =
args.kernel_index;
55 const circle::Tensor *
input;
56 const circle::Tensor *
output;
59 uint8_t *dloss_dinput_data;
61 uint8_t *dloss_doutput_data;
63 const circle::Pool2DOptions *
options;
71 assert(input !=
nullptr);
72 assert(output !=
nullptr);
79 assert(input_data !=
nullptr);
86 dloss_dinput_data = runtime_kernel.
inputs_data[inputTensorIdx];
89 assert(dloss_dinput_data !=
nullptr);
90 assert(dloss_doutput_data !=
nullptr);
96 assert(
options->fused_activation_function() == circle::ActivationFunctionType_NONE);
97 if (
options->fused_activation_function() != circle::ActivationFunctionType_NONE)
103 int32_t padding_h = 0;
104 int32_t padding_w = 0;
106 const int input_width = input_shape.dims(2);
107 const int input_height = input_shape.dims(1);
110 1 , input_height, input_width,
options->filter_height(),
111 options->filter_width(),
options->padding(), &padding_h, &padding_w);
114 params.
pad_h = padding_h;
115 params.pad_w = padding_w;
116 params.stride_h =
options->stride_h();
117 params.stride_w =
options->stride_w();
118 params.filter_h =
options->filter_height();
119 params.filter_w =
options->filter_width();
122 for (
size_t i = 0; i < input_shape.flatSize() *
sizeof(
float); i +=
sizeof(float))
123 *
static_cast<float *
>(
static_cast<void *
>(dloss_dinput_data + i)) = 0;
127 core::utils::castInputData<float>(dloss_doutput_data),
128 core::utils::castOutputData<float>(dloss_dinput_data));
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 outputTensorIdx
void computePaddingHeightWidth(int32_t stride_height, int32_t stride_width, int32_t dilation_rate_height, int32_t dilation_rate_width, int32_t in_height, int32_t in_width, int32_t filter_height, int32_t filter_width, circle::Padding padding, int32_t *padding_h, int32_t *padding_w)
void MaxPool2D(const core::Pool2DParams ¶ms, const core::OMRuntimeShape &input_shape, const float *input_data, const core::OMRuntimeShape &dloss_doutput_shape, const float *dloss_doutput_data, float *dloss_dinput_data)