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

Function TEST

tensorflow/lite/tools/optimize/quantization_utils_test.cc:47–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45using ::testing::ElementsAreArray;
46
47TEST(QuantizationUtilsTest, NumElements) {
48 TensorT tensor;
49 tensor.shape = {1, 2, 3, 4};
50 uint64_t num_elements;
51 EXPECT_EQ(kTfLiteOk, NumElements(tensor, &num_elements));
52 EXPECT_EQ(num_elements, 1 * 2 * 3 * 4);
53
54 tensor.shape = {5};
55 EXPECT_EQ(kTfLiteOk, NumElements(tensor, &num_elements));
56 EXPECT_EQ(num_elements, 5);
57
58 tensor.shape = {};
59 EXPECT_EQ(kTfLiteOk, NumElements(tensor, &num_elements));
60 EXPECT_EQ(num_elements, 1);
61}
62
63TEST(QuantizationUtilsTest, GetAsymmetricQuantizationParamsUnitRange) {
64 const float float_min = -128.0;

Callers

nothing calls this directly

Calls 15

SymmetricQuantizeTensorFunction · 0.85
ReadConvModelFunction · 0.85
QuantizeTensorFloat16Function · 0.85
AddQuantizationParamsFunction · 0.85
UnPackToMethod · 0.80
NumElementsFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected