Lines Matching refs:context

223 bool validate(const IOperationValidationContext* context) {  in validate()  argument
224 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
225 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
226 auto inputType = context->getInputType(kInputTensor); in validate()
230 NN_RET_CHECK(validateHalVersion(context, HalVersion::V1_0)); in validate()
238 NN_RET_CHECK(validateHalVersion(context, HalVersion::V1_2)); in validate()
249 const float inputScale = context->getInputShape(kInputTensor).scale; in validate()
250 const float weightsScale = context->getInputShape(kWeightsTensor).scale; in validate()
251 const float outputScale = context->getOutputShape(kOutputTensor).scale; in validate()
255 NN_RET_CHECK(validateHalVersion(context, HalVersion::V1_2)); in validate()
257 NN_RET_CHECK(validateHalVersion(context, HalVersion::V1_0)); in validate()
267 NN_RET_CHECK(validateHalVersion(context, HalVersion::V1_3)); in validate()
279 NN_RET_CHECK(validateInputTypes(context, inExpectedTypes)); in validate()
280 NN_RET_CHECK(validateOutputTypes(context, {inputType})); in validate()
282 Shape input = context->getInputShape(kInputTensor); in validate()
283 Shape weights = context->getInputShape(kWeightsTensor); in validate()
284 Shape bias = context->getInputShape(kBiasTensor); in validate()
292 bool prepare(IOperationExecutionContext* context) { in prepare() argument
293 Shape input = context->getInputShape(kInputTensor); in prepare()
294 Shape weights = context->getInputShape(kWeightsTensor); in prepare()
295 Shape bias = context->getInputShape(kBiasTensor); in prepare()
296 Shape output = context->getOutputShape(kOutputTensor); in prepare()
298 return context->setOutputShape(kOutputTensor, output); in prepare()
301 bool execute(IOperationExecutionContext* context) { in execute() argument
303 if (getNumberOfElements(context->getOutputShape(kOutputTensor)) == 0) return true; in execute()
304 switch (context->getInputType(kInputTensor)) { in execute()
306 return fullyConnectedFloat32(context->getInputBuffer<float>(kInputTensor), in execute()
307 context->getInputShape(kInputTensor), in execute()
308 context->getInputBuffer<float>(kWeightsTensor), in execute()
309 context->getInputShape(kWeightsTensor), in execute()
310 context->getInputBuffer<float>(kBiasTensor), in execute()
311 context->getInputShape(kBiasTensor), in execute()
312 context->getInputValue<int32_t>(kActivationScalar), in execute()
313 context->getOutputBuffer<float>(kOutputTensor), in execute()
314 context->getOutputShape(kOutputTensor)); in execute()
316 return fullyConnectedFloat16(context->getInputBuffer<_Float16>(kInputTensor), in execute()
317 context->getInputShape(kInputTensor), in execute()
318 context->getInputBuffer<_Float16>(kWeightsTensor), in execute()
319 context->getInputShape(kWeightsTensor), in execute()
320 context->getInputBuffer<_Float16>(kBiasTensor), in execute()
321 context->getInputShape(kBiasTensor), in execute()
322 context->getInputValue<int32_t>(kActivationScalar), in execute()
323 context->getOutputBuffer<_Float16>(kOutputTensor), in execute()
324 context->getOutputShape(kOutputTensor)); in execute()
326 return fullyConnectedQuant8(context->getInputBuffer<uint8_t>(kInputTensor), in execute()
327 context->getInputShape(kInputTensor), in execute()
328 context->getInputBuffer<uint8_t>(kWeightsTensor), in execute()
329 context->getInputShape(kWeightsTensor), in execute()
330 context->getInputBuffer<int32_t>(kBiasTensor), in execute()
331 context->getInputShape(kBiasTensor), in execute()
332 context->getInputValue<int32_t>(kActivationScalar), in execute()
333 context->getOutputBuffer<uint8_t>(kOutputTensor), in execute()
334 context->getOutputShape(kOutputTensor)); in execute()
336 return fullyConnectedQuant8(context->getInputBuffer<int8_t>(kInputTensor), in execute()
337 context->getInputShape(kInputTensor), in execute()
338 context->getInputBuffer<int8_t>(kWeightsTensor), in execute()
339 context->getInputShape(kWeightsTensor), in execute()
340 context->getInputBuffer<int32_t>(kBiasTensor), in execute()
341 context->getInputShape(kBiasTensor), in execute()
342 context->getInputValue<int32_t>(kActivationScalar), in execute()
343 context->getOutputBuffer<int8_t>(kOutputTensor), in execute()
344 context->getOutputShape(kOutputTensor)); in execute()