Lines Matching refs:context

203 bool validate(const IOperationValidationContext* context) {  in validate()  argument
204 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
205 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
207 auto inputType = context->getInputType(kRoiTensor); in validate()
208 auto deltaInputType = context->getInputType(kDeltaTensor); in validate()
224 NN_RET_CHECK(validateInputTypes(context, inExpectedTypes)); in validate()
225 NN_RET_CHECK(validateOutputTypes(context, {inputType})); in validate()
226 return validateHalVersion(context, HalVersion::V1_2); in validate()
229 bool prepare(IOperationExecutionContext* context) { in prepare() argument
230 Shape roiShape = context->getInputShape(kRoiTensor); in prepare()
231 Shape bboxDeltasShape = context->getInputShape(kDeltaTensor); in prepare()
232 Shape batchesShape = context->getInputShape(kBatchesTensor); in prepare()
233 Shape imageInfoShape = context->getInputShape(kImageInfoTensor); in prepare()
234 Shape outputShape = context->getOutputShape(kOutputTensor); in prepare()
268 NN_RET_CHECK(context->setOutputShape(kOutputTensor, outputShape)); in prepare()
272 bool execute(IOperationExecutionContext* context) { in execute() argument
275 if (getNumberOfElements(context->getOutputShape(kOutputTensor)) == 0) return true; in execute()
276 switch (context->getInputType(kRoiTensor)) { in execute()
278 return bboxTransformFloat16(context->getInputBuffer<_Float16>(kRoiTensor), in execute()
279 context->getInputShape(kRoiTensor), in execute()
280 context->getInputBuffer<_Float16>(kDeltaTensor), in execute()
281 context->getInputShape(kDeltaTensor), in execute()
282 context->getInputBuffer<int32_t>(kBatchesTensor), in execute()
283 context->getInputShape(kBatchesTensor), in execute()
284 context->getInputBuffer<_Float16>(kImageInfoTensor), in execute()
285 context->getInputShape(kImageInfoTensor), in execute()
286 context->getOutputBuffer<_Float16>(kOutputTensor), in execute()
287 context->getOutputShape(kOutputTensor)); in execute()
290 return bboxTransformFloat32(context->getInputBuffer<float>(kRoiTensor), in execute()
291 context->getInputShape(kRoiTensor), in execute()
292 context->getInputBuffer<float>(kDeltaTensor), in execute()
293 context->getInputShape(kDeltaTensor), in execute()
294 context->getInputBuffer<int32_t>(kBatchesTensor), in execute()
295 context->getInputShape(kBatchesTensor), in execute()
296 context->getInputBuffer<float>(kImageInfoTensor), in execute()
297 context->getInputShape(kImageInfoTensor), in execute()
298 context->getOutputBuffer<float>(kOutputTensor), in execute()
299 context->getOutputShape(kOutputTensor)); in execute()
302 if (context->getInputType(kDeltaTensor) == OperandType::TENSOR_QUANT8_ASYMM) { in execute()
303 return bboxTransformQuant(context->getInputBuffer<uint16_t>(kRoiTensor), in execute()
304 context->getInputShape(kRoiTensor), in execute()
305 context->getInputBuffer<uint8_t>(kDeltaTensor), in execute()
306 context->getInputShape(kDeltaTensor), in execute()
307 context->getInputBuffer<int32_t>(kBatchesTensor), in execute()
308 context->getInputShape(kBatchesTensor), in execute()
309 context->getInputBuffer<uint16_t>(kImageInfoTensor), in execute()
310 context->getInputShape(kImageInfoTensor), in execute()
311 context->getOutputBuffer<uint16_t>(kOutputTensor), in execute()
312 context->getOutputShape(kOutputTensor)); in execute()
314 return bboxTransformQuant(context->getInputBuffer<uint16_t>(kRoiTensor), in execute()
315 context->getInputShape(kRoiTensor), in execute()
316 context->getInputBuffer<int8_t>(kDeltaTensor), in execute()
317 context->getInputShape(kDeltaTensor), in execute()
318 context->getInputBuffer<int32_t>(kBatchesTensor), in execute()
319 context->getInputShape(kBatchesTensor), in execute()
320 context->getInputBuffer<uint16_t>(kImageInfoTensor), in execute()
321 context->getInputShape(kImageInfoTensor), in execute()
322 context->getOutputBuffer<uint16_t>(kOutputTensor), in execute()
323 context->getOutputShape(kOutputTensor)); in execute()
568 IOperationExecutionContext* context) { in boxWithNmsLimitWriteOutput() argument
570 Shape scoresShape = context->getInputShape(kScoreTensor); in boxWithNmsLimitWriteOutput()
576 Shape scoresOutShape = context->getOutputShape(kOutputScoreTensor); in boxWithNmsLimitWriteOutput()
578 NN_RET_CHECK(context->setOutputShape(kOutputScoreTensor, scoresOutShape)); in boxWithNmsLimitWriteOutput()
580 Shape roiOutShape = context->getOutputShape(kOutputRoiTensor); in boxWithNmsLimitWriteOutput()
582 NN_RET_CHECK(context->setOutputShape(kOutputRoiTensor, roiOutShape)); in boxWithNmsLimitWriteOutput()
584 Shape classesOutShape = context->getOutputShape(kOutputClassTensor); in boxWithNmsLimitWriteOutput()
586 NN_RET_CHECK(context->setOutputShape(kOutputClassTensor, classesOutShape)); in boxWithNmsLimitWriteOutput()
588 Shape batchesOutShape = context->getOutputShape(kOutputBatchesTensor); in boxWithNmsLimitWriteOutput()
590 NN_RET_CHECK(context->setOutputShape(kOutputBatchesTensor, batchesOutShape)); in boxWithNmsLimitWriteOutput()
594 const T_Roi* roiBase = context->getInputBuffer<T_Roi>(kRoiTensor); in boxWithNmsLimitWriteOutput()
595 const int32_t* batchesInPtr = context->getInputBuffer<int32_t>(kBatchesTensor); in boxWithNmsLimitWriteOutput()
596 T_Score* scoresOutPtr = context->getOutputBuffer<T_Score>(kOutputScoreTensor); in boxWithNmsLimitWriteOutput()
597 T_Roi* roiOutPtr = context->getOutputBuffer<T_Roi>(kOutputRoiTensor); in boxWithNmsLimitWriteOutput()
598 int32_t* classesOutPtr = context->getOutputBuffer<int32_t>(kOutputClassTensor); in boxWithNmsLimitWriteOutput()
599 int32_t* batchesOutPtr = context->getOutputBuffer<int32_t>(kOutputBatchesTensor); in boxWithNmsLimitWriteOutput()
624 const Shape& batchSplitOutShape, IOperationExecutionContext* context) { in boxWithNmsLimitFloat32() argument
636 scores_float32, context); in boxWithNmsLimitFloat32()
648 const Shape& batchSplitOutShape, IOperationExecutionContext* context) { in boxWithNmsLimitFloat16() argument
659 scores_float32, context); in boxWithNmsLimitFloat16()
670 const Shape& batchSplitOutShape, IOperationExecutionContext* context) { in boxWithNmsLimitQuant() argument
681 scores_float32, context); in boxWithNmsLimitQuant()
692 const Shape& batchSplitOutShape, IOperationExecutionContext* context) { in boxWithNmsLimitQuant() argument
704 scores_float32, context); in boxWithNmsLimitQuant()
709 bool validate(const IOperationValidationContext* context) { in validate() argument
710 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
711 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
714 auto inputType = context->getInputType(kScoreTensor); in validate()
745 NN_RET_CHECK(validateInputTypes(context, inExpectedTypes)); in validate()
746 NN_RET_CHECK(validateOutputTypes(context, outExpectedTypes)); in validate()
748 return validateHalVersion(context, HalVersion::V1_3); in validate()
750 return validateHalVersion(context, HalVersion::V1_2); in validate()
754 bool prepare(IOperationExecutionContext* context) { in prepare() argument
755 Shape scoreShape = context->getInputShape(kScoreTensor); in prepare()
756 Shape roiShape = context->getInputShape(kRoiTensor); in prepare()
757 Shape batchesShape = context->getInputShape(kBatchesTensor); in prepare()
758 Shape outputScoreShape = context->getOutputShape(kOutputScoreTensor); in prepare()
759 Shape outputRoiShape = context->getOutputShape(kOutputRoiTensor); in prepare()
760 Shape outputClassShape = context->getOutputShape(kOutputClassTensor); in prepare()
761 Shape outputBatchSplitShape = context->getOutputShape(kOutputBatchesTensor); in prepare()
786 NN_RET_CHECK(context->setOutputShape(kOutputScoreTensor, outputScoreShape)); in prepare()
796 NN_RET_CHECK(context->setOutputShape(kOutputRoiTensor, outputRoiShape)); in prepare()
800 NN_RET_CHECK(context->setOutputShape(kOutputClassTensor, outputClassShape)); in prepare()
804 NN_RET_CHECK(context->setOutputShape(kOutputBatchesTensor, outputBatchSplitShape)); in prepare()
808 bool execute(IOperationExecutionContext* context) { in execute() argument
811 if (getSizeOfDimension(context->getInputShape(kScoreTensor), 0) == 0) return true; in execute()
812 switch (context->getInputType(kScoreTensor)) { in execute()
815 context->getInputBuffer<_Float16>(kScoreTensor), in execute()
816 context->getInputShape(kScoreTensor), in execute()
817 context->getInputBuffer<_Float16>(kRoiTensor), in execute()
818 context->getInputShape(kRoiTensor), in execute()
819 context->getInputBuffer<int32_t>(kBatchesTensor), in execute()
820 context->getInputShape(kBatchesTensor), in execute()
821 context->getInputValue<_Float16>(kScoreThresholdScalar), in execute()
822 context->getInputValue<int32_t>(kMaxNumDetectionScalar), in execute()
823 context->getInputValue<int32_t>(kNmsKernelScalar), in execute()
824 context->getInputValue<_Float16>(kIoUThresholdScalar), in execute()
825 context->getInputValue<_Float16>(kSigmaScalar), in execute()
826 context->getInputValue<_Float16>(kNmsScoreThresholdScalar), in execute()
827 context->getOutputBuffer<_Float16>(kOutputScoreTensor), in execute()
828 context->getOutputShape(kOutputScoreTensor), in execute()
829 context->getOutputBuffer<_Float16>(kOutputRoiTensor), in execute()
830 context->getOutputShape(kOutputRoiTensor), in execute()
831 context->getOutputBuffer<int32_t>(kOutputClassTensor), in execute()
832 context->getOutputShape(kOutputClassTensor), in execute()
833 context->getOutputBuffer<int32_t>(kOutputBatchesTensor), in execute()
834 context->getOutputShape(kOutputBatchesTensor), context); in execute()
837 return boxWithNmsLimitFloat32(context->getInputBuffer<float>(kScoreTensor), in execute()
838 context->getInputShape(kScoreTensor), in execute()
839 context->getInputBuffer<float>(kRoiTensor), in execute()
840 context->getInputShape(kRoiTensor), in execute()
841 context->getInputBuffer<int32_t>(kBatchesTensor), in execute()
842 context->getInputShape(kBatchesTensor), in execute()
843 context->getInputValue<float>(kScoreThresholdScalar), in execute()
844 context->getInputValue<int32_t>(kMaxNumDetectionScalar), in execute()
845 context->getInputValue<int32_t>(kNmsKernelScalar), in execute()
846 context->getInputValue<float>(kIoUThresholdScalar), in execute()
847 context->getInputValue<float>(kSigmaScalar), in execute()
848 context->getInputValue<float>(kNmsScoreThresholdScalar), in execute()
849 context->getOutputBuffer<float>(kOutputScoreTensor), in execute()
850 context->getOutputShape(kOutputScoreTensor), in execute()
851 context->getOutputBuffer<float>(kOutputRoiTensor), in execute()
852 context->getOutputShape(kOutputRoiTensor), in execute()
853 context->getOutputBuffer<int32_t>(kOutputClassTensor), in execute()
854 context->getOutputShape(kOutputClassTensor), in execute()
855 context->getOutputBuffer<int32_t>(kOutputBatchesTensor), in execute()
856 context->getOutputShape(kOutputBatchesTensor), context); in execute()
859 return boxWithNmsLimitQuant(context->getInputBuffer<uint8_t>(kScoreTensor), in execute()
860 context->getInputShape(kScoreTensor), in execute()
861 context->getInputBuffer<uint16_t>(kRoiTensor), in execute()
862 context->getInputShape(kRoiTensor), in execute()
863 context->getInputBuffer<int32_t>(kBatchesTensor), in execute()
864 context->getInputShape(kBatchesTensor), in execute()
865 context->getInputValue<float>(kScoreThresholdScalar), in execute()
866 context->getInputValue<int32_t>(kMaxNumDetectionScalar), in execute()
867 context->getInputValue<int32_t>(kNmsKernelScalar), in execute()
868 context->getInputValue<float>(kIoUThresholdScalar), in execute()
869 context->getInputValue<float>(kSigmaScalar), in execute()
870 context->getInputValue<float>(kNmsScoreThresholdScalar), in execute()
871 context->getOutputBuffer<uint8_t>(kOutputScoreTensor), in execute()
872 context->getOutputShape(kOutputScoreTensor), in execute()
873 context->getOutputBuffer<uint16_t>(kOutputRoiTensor), in execute()
874 context->getOutputShape(kOutputRoiTensor), in execute()
875 context->getOutputBuffer<int32_t>(kOutputClassTensor), in execute()
876 context->getOutputShape(kOutputClassTensor), in execute()
877 context->getOutputBuffer<int32_t>(kOutputBatchesTensor), in execute()
878 context->getOutputShape(kOutputBatchesTensor), context); in execute()
881 return boxWithNmsLimitQuant(context->getInputBuffer<int8_t>(kScoreTensor), in execute()
882 context->getInputShape(kScoreTensor), in execute()
883 context->getInputBuffer<uint16_t>(kRoiTensor), in execute()
884 context->getInputShape(kRoiTensor), in execute()
885 context->getInputBuffer<int32_t>(kBatchesTensor), in execute()
886 context->getInputShape(kBatchesTensor), in execute()
887 context->getInputValue<float>(kScoreThresholdScalar), in execute()
888 context->getInputValue<int32_t>(kMaxNumDetectionScalar), in execute()
889 context->getInputValue<int32_t>(kNmsKernelScalar), in execute()
890 context->getInputValue<float>(kIoUThresholdScalar), in execute()
891 context->getInputValue<float>(kSigmaScalar), in execute()
892 context->getInputValue<float>(kNmsScoreThresholdScalar), in execute()
893 context->getOutputBuffer<int8_t>(kOutputScoreTensor), in execute()
894 context->getOutputShape(kOutputScoreTensor), in execute()
895 context->getOutputBuffer<uint16_t>(kOutputRoiTensor), in execute()
896 context->getOutputShape(kOutputRoiTensor), in execute()
897 context->getOutputBuffer<int32_t>(kOutputClassTensor), in execute()
898 context->getOutputShape(kOutputClassTensor), in execute()
899 context->getOutputBuffer<int32_t>(kOutputBatchesTensor), in execute()
900 context->getOutputShape(kOutputBatchesTensor), context); in execute()
1079 IOperationExecutionContext* context) { in generateProposalsFloat32() argument
1090 Shape scoresOutShape = context->getOutputShape(kOutputScoreTensor); in generateProposalsFloat32()
1092 NN_RET_CHECK(context->setOutputShape(kOutputScoreTensor, scoresOutShape)); in generateProposalsFloat32()
1093 Shape roiOutShape = context->getOutputShape(kOutputRoiTensor); in generateProposalsFloat32()
1095 NN_RET_CHECK(context->setOutputShape(kOutputRoiTensor, roiOutShape)); in generateProposalsFloat32()
1096 Shape batchesOutShape = context->getOutputShape(kOutputBatchesTensor); in generateProposalsFloat32()
1098 NN_RET_CHECK(context->setOutputShape(kOutputBatchesTensor, batchesOutShape)); in generateProposalsFloat32()
1101 float* scoresOutData = context->getOutputBuffer<float>(kOutputScoreTensor); in generateProposalsFloat32()
1105 float* roiOutData = context->getOutputBuffer<float>(kOutputRoiTensor); in generateProposalsFloat32()
1109 int32_t* batchesOutData = context->getOutputBuffer<int32_t>(kOutputBatchesTensor); in generateProposalsFloat32()
1122 IOperationExecutionContext* context) { in generateProposalsFloat16() argument
1142 Shape scoresOutShape = context->getOutputShape(kOutputScoreTensor); in generateProposalsFloat16()
1144 NN_RET_CHECK(context->setOutputShape(kOutputScoreTensor, scoresOutShape)); in generateProposalsFloat16()
1145 Shape roiOutShape = context->getOutputShape(kOutputRoiTensor); in generateProposalsFloat16()
1147 NN_RET_CHECK(context->setOutputShape(kOutputRoiTensor, roiOutShape)); in generateProposalsFloat16()
1148 Shape batchesOutShape = context->getOutputShape(kOutputBatchesTensor); in generateProposalsFloat16()
1150 NN_RET_CHECK(context->setOutputShape(kOutputBatchesTensor, batchesOutShape)); in generateProposalsFloat16()
1153 _Float16* scoresOutData = context->getOutputBuffer<_Float16>(kOutputScoreTensor); in generateProposalsFloat16()
1155 _Float16* roiOutData = context->getOutputBuffer<_Float16>(kOutputRoiTensor); in generateProposalsFloat16()
1157 int32_t* batchesOutData = context->getOutputBuffer<int32_t>(kOutputBatchesTensor); in generateProposalsFloat16()
1171 IOperationExecutionContext* context) { in generateProposalsQuant() argument
1194 Shape scoresOutShape = context->getOutputShape(kOutputScoreTensor); in generateProposalsQuant()
1196 NN_RET_CHECK(context->setOutputShape(kOutputScoreTensor, scoresOutShape)); in generateProposalsQuant()
1197 Shape roiOutShape = context->getOutputShape(kOutputRoiTensor); in generateProposalsQuant()
1199 NN_RET_CHECK(context->setOutputShape(kOutputRoiTensor, roiOutShape)); in generateProposalsQuant()
1200 Shape batchesOutShape = context->getOutputShape(kOutputBatchesTensor); in generateProposalsQuant()
1202 NN_RET_CHECK(context->setOutputShape(kOutputBatchesTensor, batchesOutShape)); in generateProposalsQuant()
1205 T_8QInput* scoresOutData = context->getOutputBuffer<T_8QInput>(kOutputScoreTensor); in generateProposalsQuant()
1208 uint16_t* roiOutData = context->getOutputBuffer<uint16_t>(kOutputRoiTensor); in generateProposalsQuant()
1210 int32_t* batchesOutData = context->getOutputBuffer<int32_t>(kOutputBatchesTensor); in generateProposalsQuant()
1219 bool validate(const IOperationValidationContext* context) { in validate() argument
1220 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
1221 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
1224 auto inputType = context->getInputType(kScoreTensor); in validate()
1271 NN_RET_CHECK(validateInputTypes(context, inExpectedTypes)); in validate()
1272 NN_RET_CHECK(validateOutputTypes(context, outExpectedTypes)); in validate()
1274 return validateHalVersion(context, HalVersion::V1_3); in validate()
1276 return validateHalVersion(context, HalVersion::V1_2); in validate()
1280 bool prepare(IOperationExecutionContext* context) { in prepare() argument
1281 bool useNchw = context->getInputValue<bool>(kLayoutScalar); in prepare()
1282 Shape scoreShape = context->getInputShape(kScoreTensor); in prepare()
1283 Shape bboxDeltasShape = context->getInputShape(kDeltaTensor); in prepare()
1284 Shape anchorsShape = context->getInputShape(kAnchorTensor); in prepare()
1285 Shape imageInfoDataShape = context->getInputShape(kImageInfoTensor); in prepare()
1286 Shape outputScoreShape = context->getOutputShape(kOutputScoreTensor); in prepare()
1287 Shape outputRoiShape = context->getOutputShape(kOutputRoiTensor); in prepare()
1288 Shape outputBatchSplitShape = context->getOutputShape(kOutputBatchesTensor); in prepare()
1320 NN_RET_CHECK(context->setOutputShape(kOutputScoreTensor, outputScoreShape)); in prepare()
1327 NN_RET_CHECK(context->setOutputShape(kOutputRoiTensor, outputRoiShape)); in prepare()
1330 NN_RET_CHECK(context->setOutputShape(kOutputBatchesTensor, outputBatchSplitShape)); in prepare()
1334 bool execute(IOperationExecutionContext* context) { in execute() argument
1336 switch (context->getInputType(kScoreTensor)) { in execute()
1338 return generateProposalsFloat16(context->getInputBuffer<_Float16>(kScoreTensor), in execute()
1339 context->getInputShape(kScoreTensor), in execute()
1340 context->getInputBuffer<_Float16>(kDeltaTensor), in execute()
1341 context->getInputShape(kDeltaTensor), in execute()
1342 context->getInputBuffer<_Float16>(kAnchorTensor), in execute()
1343 context->getInputShape(kAnchorTensor), in execute()
1344 context->getInputBuffer<_Float16>(kImageInfoTensor), in execute()
1345 context->getInputShape(kImageInfoTensor), in execute()
1346 context->getInputValue<_Float16>(kHeightStrideSalar), in execute()
1347 context->getInputValue<_Float16>(kWidthStrideScalar), in execute()
1348 context->getInputValue<int32_t>(kPreNmsMaxScalar), in execute()
1349 context->getInputValue<int32_t>(kPostNmsMaxScalar), in execute()
1350 context->getInputValue<_Float16>(kIoUThresholdScalar), in execute()
1351 context->getInputValue<_Float16>(kMinSizeScalar), in execute()
1352 context->getInputValue<bool>(kLayoutScalar), context); in execute()
1355 return generateProposalsFloat32(context->getInputBuffer<float>(kScoreTensor), in execute()
1356 context->getInputShape(kScoreTensor), in execute()
1357 context->getInputBuffer<float>(kDeltaTensor), in execute()
1358 context->getInputShape(kDeltaTensor), in execute()
1359 context->getInputBuffer<float>(kAnchorTensor), in execute()
1360 context->getInputShape(kAnchorTensor), in execute()
1361 context->getInputBuffer<float>(kImageInfoTensor), in execute()
1362 context->getInputShape(kImageInfoTensor), in execute()
1363 context->getInputValue<float>(kHeightStrideSalar), in execute()
1364 context->getInputValue<float>(kWidthStrideScalar), in execute()
1365 context->getInputValue<int32_t>(kPreNmsMaxScalar), in execute()
1366 context->getInputValue<int32_t>(kPostNmsMaxScalar), in execute()
1367 context->getInputValue<float>(kIoUThresholdScalar), in execute()
1368 context->getInputValue<float>(kMinSizeScalar), in execute()
1369 context->getInputValue<bool>(kLayoutScalar), context); in execute()
1372 return generateProposalsQuant(context->getInputBuffer<uint8_t>(kScoreTensor), in execute()
1373 context->getInputShape(kScoreTensor), in execute()
1374 context->getInputBuffer<uint8_t>(kDeltaTensor), in execute()
1375 context->getInputShape(kDeltaTensor), in execute()
1376 context->getInputBuffer<int16_t>(kAnchorTensor), in execute()
1377 context->getInputShape(kAnchorTensor), in execute()
1378 context->getInputBuffer<uint16_t>(kImageInfoTensor), in execute()
1379 context->getInputShape(kImageInfoTensor), in execute()
1380 context->getInputValue<float>(kHeightStrideSalar), in execute()
1381 context->getInputValue<float>(kWidthStrideScalar), in execute()
1382 context->getInputValue<int32_t>(kPreNmsMaxScalar), in execute()
1383 context->getInputValue<int32_t>(kPostNmsMaxScalar), in execute()
1384 context->getInputValue<float>(kIoUThresholdScalar), in execute()
1385 context->getInputValue<float>(kMinSizeScalar), in execute()
1386 context->getInputValue<bool>(kLayoutScalar), context); in execute()
1389 return generateProposalsQuant(context->getInputBuffer<int8_t>(kScoreTensor), in execute()
1390 context->getInputShape(kScoreTensor), in execute()
1391 context->getInputBuffer<int8_t>(kDeltaTensor), in execute()
1392 context->getInputShape(kDeltaTensor), in execute()
1393 context->getInputBuffer<int16_t>(kAnchorTensor), in execute()
1394 context->getInputShape(kAnchorTensor), in execute()
1395 context->getInputBuffer<uint16_t>(kImageInfoTensor), in execute()
1396 context->getInputShape(kImageInfoTensor), in execute()
1397 context->getInputValue<float>(kHeightStrideSalar), in execute()
1398 context->getInputValue<float>(kWidthStrideScalar), in execute()
1399 context->getInputValue<int32_t>(kPreNmsMaxScalar), in execute()
1400 context->getInputValue<int32_t>(kPostNmsMaxScalar), in execute()
1401 context->getInputValue<float>(kIoUThresholdScalar), in execute()
1402 context->getInputValue<float>(kMinSizeScalar), in execute()
1403 context->getInputValue<bool>(kLayoutScalar), context); in execute()
1575 bool validate(const IOperationValidationContext* context) { in validate() argument
1576 NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs); in validate()
1577 NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs); in validate()
1580 auto inputType = context->getInputType(kScoreTensor); in validate()
1600 NN_RET_CHECK(validateInputTypes(context, inExpectedTypes)); in validate()
1602 context, {inputType, inputType, OperandType::TENSOR_INT32, OperandType::TENSOR_INT32})); in validate()
1603 return validateHalVersion(context, HalVersion::V1_2); in validate()
1606 bool prepare(IOperationExecutionContext* context) { in prepare() argument
1607 Shape scoreShape = context->getInputShape(kScoreTensor); in prepare()
1608 Shape deltasShape = context->getInputShape(kDeltaTensor); in prepare()
1609 Shape anchorsShape = context->getInputShape(kAnchorTensor); in prepare()
1610 Shape outputScoreShape = context->getOutputShape(kOutputScoreTensor); in prepare()
1611 Shape outputRoiShape = context->getOutputShape(kOutputRoiTensor); in prepare()
1612 Shape outputClassShape = context->getOutputShape(kOutputClassTensor); in prepare()
1613 Shape outputDetectionShape = context->getOutputShape(kOutputDetectionTensor); in prepare()
1624 uint32_t maxNumDetections = context->getInputValue<int32_t>(kMaxNumDetectionScalar); in prepare()
1626 context->getInputValue<int32_t>(kMaxClassesPerDetectionScalar); in prepare()
1635 NN_RET_CHECK_GT(context->getInputValue<float>(kScaleYScalar), 0); in prepare()
1636 NN_RET_CHECK_GT(context->getInputValue<float>(kScaleXScalar), 0); in prepare()
1637 NN_RET_CHECK_GT(context->getInputValue<float>(kScaleHScalar), 0); in prepare()
1638 NN_RET_CHECK_GT(context->getInputValue<float>(kScaleWScalar), 0); in prepare()
1639 NN_RET_CHECK_GE(context->getInputValue<float>(kScoreThresholdScalar), 0); in prepare()
1640 NN_RET_CHECK_GE(context->getInputValue<float>(kIoUThresholdScalar), 0); in prepare()
1642 NN_RET_CHECK(context->getInputValue<_Float16>(kScaleYScalar) > 0); in prepare()
1643 NN_RET_CHECK(context->getInputValue<_Float16>(kScaleXScalar) > 0); in prepare()
1644 NN_RET_CHECK(context->getInputValue<_Float16>(kScaleHScalar) > 0); in prepare()
1645 NN_RET_CHECK(context->getInputValue<_Float16>(kScaleWScalar) > 0); in prepare()
1646 NN_RET_CHECK(context->getInputValue<_Float16>(kScoreThresholdScalar) >= 0); in prepare()
1647 NN_RET_CHECK(context->getInputValue<_Float16>(kIoUThresholdScalar) >= 0); in prepare()
1654 if (context->getInputValue<bool>(kUseRegularNmsScalar)) { in prepare()
1655 NN_RET_CHECK_GT(context->getInputValue<int32_t>(kMaxNumDetectionPerClassScalar), 0); in prepare()
1663 NN_RET_CHECK(context->setOutputShape(kOutputScoreTensor, outputScoreShape)); in prepare()
1667 NN_RET_CHECK(context->setOutputShape(kOutputRoiTensor, outputRoiShape)); in prepare()
1671 NN_RET_CHECK(context->setOutputShape(kOutputClassTensor, outputClassShape)); in prepare()
1675 NN_RET_CHECK(context->setOutputShape(kOutputDetectionTensor, outputDetectionShape)); in prepare()
1679 bool execute(IOperationExecutionContext* context) { in execute() argument
1681 switch (context->getInputType(kScoreTensor)) { in execute()
1684 context->getInputBuffer<_Float16>(kScoreTensor), in execute()
1685 context->getInputShape(kScoreTensor), in execute()
1686 context->getInputBuffer<_Float16>(kDeltaTensor), in execute()
1687 context->getInputShape(kDeltaTensor), in execute()
1688 context->getInputBuffer<_Float16>(kAnchorTensor), in execute()
1689 context->getInputShape(kAnchorTensor), in execute()
1690 context->getInputValue<_Float16>(kScaleYScalar), in execute()
1691 context->getInputValue<_Float16>(kScaleXScalar), in execute()
1692 context->getInputValue<_Float16>(kScaleHScalar), in execute()
1693 context->getInputValue<_Float16>(kScaleWScalar), in execute()
1694 context->getInputValue<bool>(kUseRegularNmsScalar), in execute()
1695 context->getInputValue<int32_t>(kMaxNumDetectionScalar), in execute()
1696 context->getInputValue<int32_t>(kMaxClassesPerDetectionScalar), in execute()
1697 context->getInputValue<int32_t>(kMaxNumDetectionPerClassScalar), in execute()
1698 context->getInputValue<_Float16>(kIoUThresholdScalar), in execute()
1699 context->getInputValue<_Float16>(kScoreThresholdScalar), in execute()
1700 context->getInputValue<bool>(kIsBGInLabelScalar), in execute()
1701 context->getOutputBuffer<_Float16>(kOutputScoreTensor), in execute()
1702 context->getOutputShape(kOutputScoreTensor), in execute()
1703 context->getOutputBuffer<_Float16>(kOutputRoiTensor), in execute()
1704 context->getOutputShape(kOutputRoiTensor), in execute()
1705 context->getOutputBuffer<int32_t>(kOutputClassTensor), in execute()
1706 context->getOutputShape(kOutputClassTensor), in execute()
1707 context->getOutputBuffer<int32_t>(kOutputDetectionTensor), in execute()
1708 context->getOutputShape(kOutputDetectionTensor)); in execute()
1712 context->getInputBuffer<float>(kScoreTensor), in execute()
1713 context->getInputShape(kScoreTensor), in execute()
1714 context->getInputBuffer<float>(kDeltaTensor), in execute()
1715 context->getInputShape(kDeltaTensor), in execute()
1716 context->getInputBuffer<float>(kAnchorTensor), in execute()
1717 context->getInputShape(kAnchorTensor), in execute()
1718 context->getInputValue<float>(kScaleYScalar), in execute()
1719 context->getInputValue<float>(kScaleXScalar), in execute()
1720 context->getInputValue<float>(kScaleHScalar), in execute()
1721 context->getInputValue<float>(kScaleWScalar), in execute()
1722 context->getInputValue<bool>(kUseRegularNmsScalar), in execute()
1723 context->getInputValue<int32_t>(kMaxNumDetectionScalar), in execute()
1724 context->getInputValue<int32_t>(kMaxClassesPerDetectionScalar), in execute()
1725 context->getInputValue<int32_t>(kMaxNumDetectionPerClassScalar), in execute()
1726 context->getInputValue<float>(kIoUThresholdScalar), in execute()
1727 context->getInputValue<float>(kScoreThresholdScalar), in execute()
1728 context->getInputValue<bool>(kIsBGInLabelScalar), in execute()
1729 context->getOutputBuffer<float>(kOutputScoreTensor), in execute()
1730 context->getOutputShape(kOutputScoreTensor), in execute()
1731 context->getOutputBuffer<float>(kOutputRoiTensor), in execute()
1732 context->getOutputShape(kOutputRoiTensor), in execute()
1733 context->getOutputBuffer<int32_t>(kOutputClassTensor), in execute()
1734 context->getOutputShape(kOutputClassTensor), in execute()
1735 context->getOutputBuffer<int32_t>(kOutputDetectionTensor), in execute()
1736 context->getOutputShape(kOutputDetectionTensor)); in execute()