all_ops_resolver.cc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. ==============================================================================*/
  12. #include "tensorflow/lite/micro/all_ops_resolver.h"
  13. #include "tensorflow/lite/micro/kernels/micro_ops.h"
  14. namespace tflite {
  15. namespace ops {
  16. namespace micro {
  17. namespace custom {
  18. TfLiteRegistration* Register_ETHOSU();
  19. const char* GetString_ETHOSU();
  20. } // namespace custom
  21. } // namespace micro
  22. } // namespace ops
  23. AllOpsResolver::AllOpsResolver() {
  24. // Please keep this list of Builtin Operators in alphabetical order.
  25. AddAbs();
  26. AddAdd();
  27. AddArgMax();
  28. AddArgMin();
  29. AddAveragePool2D();
  30. AddCeil();
  31. AddConcatenation();
  32. AddConv2D();
  33. AddCos();
  34. AddDepthwiseConv2D();
  35. AddDequantize();
  36. AddEqual();
  37. AddFloor();
  38. AddFullyConnected();
  39. AddGreater();
  40. AddGreaterEqual();
  41. AddHardSwish();
  42. AddL2Normalization();
  43. AddLess();
  44. AddLessEqual();
  45. AddLog();
  46. AddLogicalAnd();
  47. AddLogicalNot();
  48. AddLogicalOr();
  49. AddLogistic();
  50. AddMaximum();
  51. AddMaxPool2D();
  52. AddMean();
  53. AddMinimum();
  54. AddMul();
  55. AddNeg();
  56. AddNotEqual();
  57. AddPack();
  58. AddPad();
  59. AddPadV2();
  60. AddPrelu();
  61. AddQuantize();
  62. AddRelu();
  63. AddRelu6();
  64. AddReshape();
  65. AddResizeNearestNeighbor();
  66. AddRound();
  67. AddRsqrt();
  68. AddSin();
  69. AddSoftmax();
  70. AddSplit();
  71. AddSqrt();
  72. AddSquare();
  73. AddStridedSlice();
  74. AddSub();
  75. AddSvdf();
  76. AddTanh();
  77. AddUnpack();
  78. // TODO(b/159644355): Figure out if custom Ops belong in AllOpsResolver.
  79. TfLiteRegistration* registration =
  80. tflite::ops::micro::custom::Register_ETHOSU();
  81. if (registration) {
  82. AddCustom(tflite::ops::micro::custom::GetString_ETHOSU(), registration);
  83. }
  84. }
  85. } // namespace tflite