MCPcopy Create free account
hub / github.com/apache/singa / TEST_F

Function TEST_F

test/singa/test_tensor_math.cc:45–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43};
44
45TEST_F(TensorMath, AbsCpp) {
46 Tensor aa = a.Clone();
47 Tensor bb = b.Clone();
48 Tensor cc = aa - bb;
49 const float *dptr = cc.data<float>();
50 EXPECT_NEAR(-0.1, dptr[0], 1e-5);
51 EXPECT_NEAR(-0.1, dptr[1], 1e-5);
52 EXPECT_NEAR(-0.1, dptr[2], 1e-5);
53
54 Tensor p = Abs(cc);
55 const float *dptr1 = p.data<float>();
56 EXPECT_NEAR(0.1, dptr1[0], 1e-5);
57 EXPECT_NEAR(0.1, dptr1[1], 1e-5);
58 EXPECT_NEAR(0.1, dptr1[2], 1e-5);
59}
60
61TEST_F(TensorMath, ExpCpp) {
62 Tensor p = Exp(a);

Callers

nothing calls this directly

Calls 15

SquareFunction · 0.85
TanhClass · 0.85
MultFunction · 0.85
AddColumnFunction · 0.85
SubColumnFunction · 0.85
DivColumnFunction · 0.85
AddRowFunction · 0.85
SubRowFunction · 0.85
MultRowFunction · 0.85
MultColumnFunction · 0.85
DivRowFunction · 0.85
SumRowsFunction · 0.85

Tested by

no test coverage detected