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

Function TEST_F

test/singa/test_opencl.cc:59–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57};
58
59TEST_F(OpenCL_TensorMath, MemberAbs) {
60 Tensor aa = a.Clone();
61 Tensor bb = b.Clone();
62 Tensor cc = aa - bb;
63
64 cc.ToHost();
65 const float *dptr = cc.data<float>();
66 EXPECT_NEAR(-0.1, dptr[0], 1e-5);
67 EXPECT_NEAR(-0.1, dptr[1], 1e-5);
68 EXPECT_NEAR(-0.1, dptr[2], 1e-5);
69
70 Tensor p = Abs(cc);
71 const float *dptr1 = p.data<float>();
72 EXPECT_NEAR(0.1, dptr1[0], 1e-5);
73 EXPECT_NEAR(0.1, dptr1[1], 1e-5);
74 EXPECT_NEAR(0.1, dptr1[2], 1e-5);
75}
76
77// TEST_F(OpenCL_TensorMath, MemberClamp) { }
78

Callers

nothing calls this directly

Calls 15

SquareFunction · 0.85
TanhClass · 0.85
MultFunction · 0.85
ToHostMethod · 0.80
shapeMethod · 0.80
deviceMethod · 0.80
data_typeMethod · 0.80
AbsClass · 0.50
ExpClass · 0.50
expFunction · 0.50
LogClass · 0.50
logFunction · 0.50

Tested by

no test coverage detected