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

Function TEST

tensorflow/lite/kernels/internal/tensor_utils_test.cc:28–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace tensor_utils {
27
28TEST(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
40TEST(uKernels, VectorScalarMultiply) {
41 constexpr int kVectorSize = 29;

Callers

nothing calls this directly

Calls 15

aligned_mallocFunction · 0.85
aligned_freeFunction · 0.85
VectorBatchVectorAssignFunction · 0.85
VectorShiftLeftFunction · 0.85
ClipVectorFunction · 0.50
ArrayFloatNearFunction · 0.50
VectorScalarMultiplyFunction · 0.50
IsZeroVectorFunction · 0.50
SymmetricQuantizeFloatsFunction · 0.50
fillFunction · 0.50

Tested by

no test coverage detected