MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / QuantizedNoActivation

Function QuantizedNoActivation

tensorflow/lite/kernels/div_test.cc:188–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187template <TensorType tensor_type, typename integer_dtype>
188void 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
202TEST(QuantizedDivOpTest, QuantizedNoActivationUInt8) {
203 QuantizedNoActivation<TensorType_UINT8, uint8_t>();

Callers

nothing calls this directly

Calls 5

GetToleranceFunction · 0.70
ArrayFloatNearFunction · 0.70
input1Method · 0.45
input2Method · 0.45
InvokeMethod · 0.45

Tested by

no test coverage detected