| 162 | // tensor.a |
| 163 | template <typename T> |
| 164 | void CalculateActivationRange(TfLiteFusedActivation activation, |
| 165 | T* activation_min, T* activation_max) { |
| 166 | if (activation == kTfLiteActRelu) { |
| 167 | *activation_min = 0; |
| 168 | *activation_max = std::numeric_limits<T>::max(); |
| 169 | } else if (activation == kTfLiteActRelu6) { |
| 170 | *activation_min = 0; |
| 171 | *activation_max = 6; |
| 172 | } else if (activation == kTfLiteActRelu1) { |
| 173 | *activation_min = -1; |
| 174 | *activation_max = 1; |
| 175 | } else { |
| 176 | *activation_min = std::numeric_limits<T>::lowest(); |
| 177 | *activation_max = std::numeric_limits<T>::max(); |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | // Return true if the given tensors have the same shape. |
| 182 | bool HaveSameShapes(const TfLiteTensor* input1, const TfLiteTensor* input2); |
no test coverage detected