33constexpr int inputTensorIdx = 0;
34constexpr int weightsFeatureTensorIdx = 1;
35constexpr int weightsTimeTensorIdx = 2;
36constexpr int biasTensorIdx = 3;
37constexpr int inputActivationStateTensorIdx =
43OMStatus onert_micro::import::configure_kernel_CircleSVDF(
const OMConfigureArgs &config_args)
53 uint16_t op_index = config_args.kernel_index;
56 runtime_kernel.
readKernel(op_index, runtime_context);
58 const circle::Tensor *
input = runtime_kernel.
inputs[inputTensorIdx];
59 const circle::Tensor *weights_feature = runtime_kernel.
inputs[weightsFeatureTensorIdx];
60 const circle::Tensor *weights_time = runtime_kernel.
inputs[weightsTimeTensorIdx];
61 const circle::Tensor *
bias = runtime_kernel.
inputs[biasTensorIdx];
62 const circle::Tensor *activation_state = runtime_kernel.
inputs[inputActivationStateTensorIdx];
66 assert(input !=
nullptr);
67 assert(weights_feature !=
nullptr);
68 assert(weights_time !=
nullptr);
70 assert(activation_state !=
nullptr);
71 assert(output !=
nullptr);
76 status = utils::checkCondition(options !=
nullptr);
87 const int rank =
options->rank();
88 const int input_size = input_shape.dims(1);
89 const int batch_size = input_shape.dims(0);
90 const int num_filters = weights_feature_shape.dims(0);
91 status = utils::checkCondition(num_filters % rank == 0);
95 const int num_units = num_filters / rank;
96 const int memory_size = weights_time_shape.dims(1);
98 status = utils::checkCondition(input_shape.dimensionsCount() == 2);
110 status = utils::checkCondition(weights_feature_shape.dimensionsCount() == 2 and
111 weights_feature_shape.dims(1) == input_size);
116 status = utils::checkCondition(weights_time_shape.dimensionsCount() == 2 and
117 weights_time_shape.dims(0) == num_filters and
118 weights_time_shape.dims(1) == memory_size);
125 status = utils::checkCondition(
OMRuntimeShape(bias).dims(0) == num_units);
131 status = utils::checkCondition(activation_state_shape.dimensionsCount() == 2 and
132 activation_state_shape.dims(0) == batch_size and
133 activation_state_shape.dims(1) == memory_size * num_filters);
137 if (
input->type() == circle::TensorType_FLOAT32)
139 status = utils::checkCondition(weights_feature->type() == circle::TensorType_FLOAT32 and
140 weights_time->type() == circle::TensorType_FLOAT32 and
141 activation_state->type() == circle::TensorType_FLOAT32 and
142 output->type() == circle::TensorType_FLOAT32);
147 status = utils::checkCondition(
bias->type() == circle::TensorType_FLOAT32);
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