Daniel Konegen / MNIST_example

Dependencies:   mbed-os

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers micro_utils.h Source File

micro_utils.h

00001 /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
00002 Licensed under the Apache License, Version 2.0 (the "License");
00003 you may not use this file except in compliance with the License.
00004 You may obtain a copy of the License at
00005     http://www.apache.org/licenses/LICENSE-2.0
00006 Unless required by applicable law or agreed to in writing, software
00007 distributed under the License is distributed on an "AS IS" BASIS,
00008 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00009 See the License for the specific language governing permissions and
00010 limitations under the License.
00011 ==============================================================================*/
00012 #ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_KERNELS_MICRO_UTILS_H_
00013 #define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_KERNELS_MICRO_UTILS_H_
00014 namespace tflite {
00015 namespace ops {
00016 namespace micro {
00017 
00018 // Same as gtl::Greater but defined here to reduce dependencies and
00019 // binary size for micro environment.
00020 struct Greater {
00021   template <typename T>
00022   bool operator()(const T& x, const T& y) const {
00023     return x > y;
00024   }
00025 };
00026 
00027 struct Less {
00028   template <typename T>
00029   bool operator()(const T& x, const T& y) const {
00030     return x < y;
00031   }
00032 };
00033 
00034 }  // namespace micro
00035 }  // namespace ops
00036 }  // namespace tflite
00037 #endif  // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_KERNELS_MICRO_UTILS_H_