29constexpr uint32_t inputTensorIdx = 0;
30constexpr uint32_t positionsTensorIdx = 1;
35OMStatus onert_micro::import::configure_kernel_CircleGather(
const OMConfigureArgs &config_args)
38 uint16_t op_index = config_args.kernel_index;
46 const circle::Tensor *
input = runtime_kernel.
inputs[inputTensorIdx];
47 const circle::Tensor *positions = runtime_kernel.
inputs[positionsTensorIdx];
50 assert(input !=
nullptr);
51 assert(positions !=
nullptr);
52 assert(output !=
nullptr);
54 status = utils::checkCondition(
input->type() ==
output->type());
60 if (options ==
nullptr)
63 status = utils::checkCondition(positions->type() == circle::TensorType_INT32);
67 auto input_type =
input->type();
68 status = utils::checkCondition(input_type == circle::TensorType_INT32 or
69 input_type == circle::TensorType_FLOAT32 or
70 input_type == circle::TensorType_INT8);
75 if (input_type == circle::TensorType_INT8)
77 status = utils::checkCondition(*
output->quantization()->scale()->begin() ==
78 *
input->quantization()->scale()->begin());
81 status = utils::checkCondition(*
output->quantization()->zero_point()->begin() ==
82 *
input->quantization()->zero_point()->begin());
93 int32_t num_dims = input_shape.dimensionsCount();
99 status = utils::checkCondition(axis >= 0 and axis < num_dims);
103 int32_t batch_dims =
options->batch_dims();
104 int32_t coords_num_dims = positions_shape.dimensionsCount();
109 batch_dims += coords_num_dims;
112 status = utils::checkCondition(batch_dims <= axis and batch_dims >= 0 and
113 batch_dims < num_dims and batch_dims <= coords_num_dims);
118 for (
int i = 0; i < batch_dims; ++i)
120 status = utils::checkCondition(input_shape.dims(i) == positions_shape.dims(i));
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]
constexpr uint32_t outputTensorIdx