| 26 | namespace tensor_utils { |
| 27 | |
| 28 | TEST(uKernels, ClipTest) { |
| 29 | constexpr int kVectorSize = 10; |
| 30 | constexpr float kAbsLimit = 2.0; |
| 31 | static float input[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0, |
| 32 | -2.5, 3.0, -3.5, 4.0, -4.5}; |
| 33 | std::vector<float> output(kVectorSize); |
| 34 | ClipVector(input, kVectorSize, kAbsLimit, output.data()); |
| 35 | EXPECT_THAT(output, |
| 36 | ElementsAreArray(ArrayFloatNear( |
| 37 | {0.0, -0.5, 1.0, -1.5, 2.0, -2.0, 2.0, -2.0, 2.0, -2.0}))); |
| 38 | } |
| 39 | |
| 40 | TEST(uKernels, VectorScalarMultiply) { |
| 41 | constexpr int kVectorSize = 29; |
nothing calls this directly
no test coverage detected