| 541 | } |
| 542 | |
| 543 | TfLiteStatus ArmnnSubgraph::VisitNode(DelegateData& delegateData, |
| 544 | TfLiteContext* tfLiteContext, |
| 545 | TfLiteRegistration* tfLiteRegistration, |
| 546 | TfLiteNode* tfLiteNode, |
| 547 | int nodeIndex) |
| 548 | { |
| 549 | switch (tfLiteRegistration->builtin_code) |
| 550 | { |
| 551 | case kTfLiteBuiltinCustom: |
| 552 | { |
| 553 | #if defined(ARMNN_POST_TFLITE_2_5) |
| 554 | // Custom operators are defined by the name rather than the builtin code. |
| 555 | // Parse the custom_name param in the registration to point to the correct visitor function. |
| 556 | std::string customOperatorName = tfLiteRegistration->custom_name; |
| 557 | if ( customOperatorName == "AveragePool3D" ) |
| 558 | { |
| 559 | return VisitPooling3dOperator(delegateData, |
| 560 | tfLiteContext, |
| 561 | tfLiteNode, |
| 562 | nodeIndex, |
| 563 | customOperatorName); |
| 564 | } |
| 565 | else if (customOperatorName == "MaxPool3D") |
| 566 | { |
| 567 | return VisitPooling3dOperator(delegateData, |
| 568 | tfLiteContext, |
| 569 | tfLiteNode, |
| 570 | nodeIndex, |
| 571 | customOperatorName); |
| 572 | } |
| 573 | #endif |
| 574 | // Invalid or unsupported custom operator |
| 575 | return kTfLiteError; |
| 576 | } |
| 577 | case kTfLiteBuiltinAbs: |
| 578 | return VisitElementwiseUnaryOperator(delegateData, |
| 579 | tfLiteContext, |
| 580 | tfLiteNode, |
| 581 | nodeIndex, |
| 582 | armnn::UnaryOperation::Abs); |
| 583 | case kTfLiteBuiltinAdd: |
| 584 | return VisitElementwiseBinaryOperator(delegateData, |
| 585 | tfLiteContext, |
| 586 | tfLiteNode, |
| 587 | nodeIndex, |
| 588 | kTfLiteBuiltinAdd); |
| 589 | case kTfLiteBuiltinArgMax: |
| 590 | return VisitArgMinMaxOperator(delegateData, |
| 591 | tfLiteContext, |
| 592 | tfLiteNode, |
| 593 | nodeIndex, |
| 594 | kTfLiteBuiltinArgMax); |
| 595 | case kTfLiteBuiltinArgMin: |
| 596 | return VisitArgMinMaxOperator(delegateData, |
| 597 | tfLiteContext, |
| 598 | tfLiteNode, |
| 599 | nodeIndex, |
| 600 | kTfLiteBuiltinArgMin); |
nothing calls this directly
no test coverage detected