| 186 | |
| 187 | template <TensorType tensor_type, typename integer_dtype> |
| 188 | void QuantizedNoActivation() { |
| 189 | const float kQuantizedTolerance = GetTolerance(-1.0, 1.0); |
| 190 | QuantizedDivOpModel m({tensor_type, {1, 2, 2, 1}, -1.0, 1.0}, |
| 191 | {tensor_type, {1, 2, 2, 1}, -1.0, 1.0}, |
| 192 | {tensor_type, {}, -1.0, 1.0}, |
| 193 | ActivationFunctionType_NONE); |
| 194 | m.QuantizeAndPopulate<integer_dtype>(m.input1(), {-0.8, -0.2, 0.3, 0.7}); |
| 195 | m.QuantizeAndPopulate<integer_dtype>(m.input2(), {-0.8, 0.4, 0.8, 1.0}); |
| 196 | m.Invoke(); |
| 197 | EXPECT_THAT(m.GetDequantizedOutput<integer_dtype>(), |
| 198 | ElementsAreArray(ArrayFloatNear({1.0, -0.5, 0.375, 0.7}, |
| 199 | kQuantizedTolerance))); |
| 200 | } |
| 201 | |
| 202 | TEST(QuantizedDivOpTest, QuantizedNoActivationUInt8) { |
| 203 | QuantizedNoActivation<TensorType_UINT8, uint8_t>(); |
nothing calls this directly
no test coverage detected