| 45 | using ::testing::ElementsAreArray; |
| 46 | |
| 47 | TEST(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 | |
| 63 | TEST(QuantizationUtilsTest, GetAsymmetricQuantizationParamsUnitRange) { |
| 64 | const float float_min = -128.0; |
nothing calls this directly
no test coverage detected