35constexpr uint32_t input3TensorIdx = 2;
46 const circle::Tensor *input1;
47 const circle::Tensor *input2;
48 const circle::Tensor *input3;
49 const circle::Tensor *
output;
56 const circle::PadOptions *
options;
60 runtime_kernel.
readKernel(op_index, runtime_context);
64 input3 = runtime_kernel.
inputs[input3TensorIdx];
66 assert(input1 !=
nullptr);
67 assert(input2 !=
nullptr);
69 assert(output !=
nullptr);
77 assert(input1_data !=
nullptr);
78 assert(input2_data !=
nullptr);
80 assert(output_data !=
nullptr);
93 const auto num_input_dimensions = input1_shape.dimensionsCount();
94 assert(num_input_dimensions <= 5);
96 if (num_input_dimensions > 5)
99 pad_params.left_padding_count = num_input_dimensions;
100 pad_params.right_padding_count = num_input_dimensions;
102 auto *paddings_data =
reinterpret_cast<int32_t *
>(
input2_data);
103 for (
int idx = num_input_dimensions - 1; idx >= 0; --idx)
105 pad_params.left_padding[idx] = paddings_data[idx * 2];
106 pad_params.right_padding[idx] = paddings_data[idx * 2 + 1];
109 switch (input1->type())
112 case circle::TensorType_FLOAT32:
115 status =
pal::Pad(pad_params, input1_shape, core::utils::castInputData<float>(input1_data),
116 pad_value,
output_shape, core::utils::castOutputData<float>(output_data));
123 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
const std::vector< float > input3_data
OMStatus Pad(const core::PadParams &op_params, const core::OMRuntimeShape &input_shape, const float *input_data, const float pad_value, const core::OMRuntimeShape &output_shape, float *output_data)
core::OMRuntimeContext & runtime_context
core::OMRuntimeStorage & runtime_storage