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

Function TEST

tensorflow/lite/delegates/gpu/gl/kernels/add_test.cc:33–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace {
32
33TEST(AddTest, TwoInputTensorsOfTheSameShape) {
34 TensorRef<BHWC> augend, addend, output;
35 augend.type = DataType::FLOAT32;
36 augend.ref = 0;
37 augend.shape = BHWC(1, 2, 2, 1);
38
39 addend.type = DataType::FLOAT32;
40 addend.ref = 1;
41 addend.shape = BHWC(1, 2, 2, 1);
42
43 output.type = DataType::FLOAT32;
44 output.ref = 2;
45 output.shape = BHWC(1, 2, 2, 1);
46
47 AddAttributes attr;
48 SingleOpModel model({ToString(OperationType::ADD), std::move(attr)},
49 {augend, addend}, {output});
50 ASSERT_TRUE(model.PopulateTensor(0, {-2.0, 0.2, 0.7, 0.8}));
51 ASSERT_TRUE(model.PopulateTensor(1, {0.1, 0.2, 0.3, 0.5}));
52 ASSERT_OK(model.Invoke(*NewAddNodeShader()));
53 EXPECT_THAT(model.GetOutput(0),
54 Pointwise(FloatNear(1e-6), {-1.9, 0.4, 1.0, 1.3}));
55}
56
57TEST(AddTest, InputTensorAndScalar) {
58 AddAttributes attr;

Callers

nothing calls this directly

Calls 6

NewAddNodeShaderFunction · 0.85
ToStringFunction · 0.50
PopulateTensorMethod · 0.45
InvokeMethod · 0.45
GetOutputMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected