leaky_relu.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Copyright 2021 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. #ifndef TENSORFLOW_LITE_MICRO_KERNELS_LEAKY_RELU_H_
  13. #define TENSORFLOW_LITE_MICRO_KERNELS_LEAKY_RELU_H_
  14. #include "tensorflow/lite/c/common.h"
  15. namespace tflite {
  16. // Input/output tensor index.
  17. extern const int kInputTensor;
  18. extern const int kOutputTensor;
  19. struct LeakyReluOpData {
  20. // quantization parameters
  21. int32_t output_multiplier_alpha;
  22. int32_t output_shift_alpha;
  23. int32_t output_multiplier_identity;
  24. int32_t output_shift_identity;
  25. int32_t input_zero_point;
  26. int32_t output_zero_point;
  27. };
  28. TfLiteStatus CalculateOpDataLeakyRelu(TfLiteContext* context, TfLiteNode* node);
  29. TfLiteStatus LeakyReluPrepare(TfLiteContext* context, TfLiteNode* node);
  30. } // namespace tflite
  31. #endif // TENSORFLOW_LITE_MICRO_KERNELS_LEAKY_RELU_H_