33constexpr uint32_t inputTensorIdx = 0;
34constexpr uint32_t weightTensorIdx = 1;
35constexpr uint32_t biasTensorIdx = 2;
42onert_micro::import::configure_kernel_CircleDepthwiseConv2D(
const OMConfigureArgs &config_args)
45 uint16_t op_index = config_args.kernel_index;
48 runtime_kernel.
readKernel(op_index, runtime_context);
50 const circle::Tensor *
input = runtime_kernel.
inputs[inputTensorIdx];
51 const circle::Tensor *weight = runtime_kernel.
inputs[weightTensorIdx];
52 const circle::Tensor *
bias = runtime_kernel.
inputs[biasTensorIdx];
56 assert(input !=
nullptr);
57 assert(weight !=
nullptr);
59 assert(output !=
nullptr);
69 status = utils::checkCondition(
input->type() ==
output->type());
73 status = utils::checkCondition(
input->type() == weight->type());
77 status = utils::checkCondition(input_shape.dimensionsCount() == 4);
85 status = utils::checkCondition(input_shape.dimensionsCount() == weight_shape.dimensionsCount());
91 status = utils::checkCondition(
92 bias ==
nullptr or (bias_shape.dimensionsCount() == 1 && bias_shape.dims(0) == output_depth));
96 switch (
options->fused_activation_function())
98 case circle::ActivationFunctionType_NONE:
99 case circle::ActivationFunctionType_RELU:
100 case circle::ActivationFunctionType_RELU6:
101 case circle::ActivationFunctionType_RELU_N1_TO_1:
107 if (
input->type() == circle::TensorType_FLOAT32)
109 status = utils::checkCondition(bias ==
nullptr or
input->type() ==
bias->type());
113 auto input_quant =
input->quantization();
114 auto filter_quant = weight->quantization();
115 auto output_quant =
output->quantization();
117 status = utils::checkCondition(input_quant !=
nullptr and filter_quant !=
nullptr and
118 output_quant !=
nullptr);
122 auto input_scales = input_quant->scale();
123 auto filter_scales = filter_quant->scale();
124 auto output_scales = output_quant->scale();
126 status = utils::checkCondition(input_scales !=
nullptr and filter_scales !=
nullptr and
127 output_scales !=
nullptr);
132 status = utils::checkCondition(filter_scales->size() > 1);
int32_t dimensionsCount() const
int32_t dims(int i) const
const circle::Operator * first_operator
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