constants.h 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. /* Copyright 2019 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_EXAMPLES_HELLO_WORLD_CONSTANTS_H_
  13. #define TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_CONSTANTS_H_
  14. // This constant represents the range of x values our model was trained on,
  15. // which is from 0 to (2 * Pi). We approximate Pi to avoid requiring additional
  16. // libraries.
  17. const float PI = 3.14159265359f;
  18. const float kXrange = 2.f * PI;
  19. // This constant determines the number of inferences to perform across the range
  20. // of x values defined above. Since each inference takes time, the higher this
  21. // number, the more time it will take to run through the entire range. The value
  22. // of this constant can be tuned so that one full cycle takes a desired amount
  23. // of time. Since different devices take different amounts of time to perform
  24. // inference, this value should be defined per-device.
  25. extern const int kInferencesPerCycle;
  26. #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_CONSTANTS_H_